Soapbosnia Posted May 14, 2018 Share Posted May 14, 2018 Hi guys,i never tried this and idk what to use for this but,how do i make a image on the screen spin? Thanks. Link to comment
Addlibs Posted May 14, 2018 Share Posted May 14, 2018 If you're talking about a dxDraw image, you simply need to increase the rotation of the image (6th argument in dxDrawImage), based on tick count or frames or whatever. 1 Link to comment
Guest Posted July 25, 2018 Share Posted July 25, 2018 (edited) you can use getTickCount() / 20 % 360) example: dxDrawImage((***/***)*sWidth, (***/***)*sHeight, (***/***)*sWidth, (***/***)*sHeight, "Yourimg.png", getTickCount() / 20 % 360) Edited July 25, 2018 by Guest Link to comment
Skream Posted August 2, 2018 Share Posted August 2, 2018 On 24/07/2018 at 21:04, Scarfas said: you can use getTickCount() / 20 % 360) example: dxDrawImage((***/***)*sWidth, (***/***)*sHeight, (***/***)*sWidth, (***/***)*sHeight, "Yourimg.png", getTickCount() / 20 % 360) I think that / 20 makes no diff Link to comment
Addlibs Posted August 3, 2018 Share Posted August 3, 2018 (edited) If anything, it's the modulo operator that's redundant here, as the rotation argument will take any number, not necessarily one that is truly between 0 and 360. Regarding the division, it should make a difference -- diving the tick count will slow it down, in this case, the ticks will increment 20× slower, meaning a 20× slower rotation speed, from 1000 deg·s-1 to 50 deg·s-1 Edited August 3, 2018 by MrTasty 1 Link to comment
Skream Posted August 4, 2018 Share Posted August 4, 2018 I think it makes no difference if you divide gettickcount for 20 or 1000 because % is going to reset the number every 360. getTickCount gets computer uptime isn't? its not going to make a diff because onClientRender doesn't trigger every ms. It triggers more like every 5 ms I think (getTickCount() % 360) / 20 I think this may do what you said. But still it wouldn't make a 360 rotation like he said cuz the max rotation would be like 18deg Link to comment
Addlibs Posted August 4, 2018 Share Posted August 4, 2018 (edited) Let's assume tick count is 1000 this frame, and 1016.6666667 on the next frame (60 FPS). That is a 16.6666667 increase in tick count. 1000.0000000 ÷ 20 = 50.0000000 1016.6666667 ÷ 20 = 50.8333333 This is a 0.8333333 increase rather than a 16.6666667 increase, an increase 20 times lower, thus making the rotation per frame slower by 20. Note that the modulo operation doesn't reset the tick count number but only the resulting number of the modulo operation. On the other hand, if you did modulo first and division later, you wouldn't be able to get a degree higher than 360° / 20, that is, 18°, which isn't what was intended in this situation. Edited August 4, 2018 by MrTasty Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now