Forum

> > CS2D > Scripts > Image rot check
Forums overviewCS2D overview Scripts overviewLog in to reply

English Image rot check

8 replies
To the start Previous 1 Next To the start

old Image rot check

Mora
User Off Offline

Quote
Hello us
oh i was not active for a long time..ll bcs i has no net.. and i've start to do anything in cs2d with lua..
I want to know how to check image rotate.
Example i have image kudygjfggf
this image its gonna rotate as fast as i will set the rotation speed for it when player rotate its more / smaller than pl. rot.
1
2
3
4
5
6
kudygjfggf = {
speed = "5"
}
kudygjfggf [id] =image...
If kudygjfggf[id].rotate<player rot then
Rotate kudygjfggf[id].speed
Thank you and sorry for my terrible text.. small phone is very small.. hard to writte..
Thank u

old Re: Image rot check

Rainoth
Moderator Off Offline

Quote
Well, whenever you rotate the image, you got to have some kind of variable to rotate it with, if not, you can just store the rotation in one and set it. Tadaah.. There's your image rotation...

old Re: Image rot check

Mora
User Off Offline

Quote
@Rainoth, i mean.. oh so hard.. this phone dont let me..
I forget to writte:
1
2
3
4
5
6
If imagerot>plaelyerrot then
Tween rotate(with speed i ve SET)
Elseif imagerot<playerrot then
Tween rotate(with - speed i ve set)
Elseif imagerot==playerrot then
Image is no rotate
maybe I ve not right understand u, but my engizzz is bat.. and there is source of urs info?

old Re: Image rot check

Mora
User Off Offline

Quote
@Infinite Rain, so, i can replace object(id,'rot') to object(img[id],'rot')?
Thank u bebis,i ll try it later..

old Re: Image rot check

Mora
User Off Offline

Quote
/@Inf Rain: thank you, its work, but idk there is no 360 but 180 and - 180 rad. When my rot is ~180 and ~-180 its move to another way
not so matterness text >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview