Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetSpriteScale Problem

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 16th Mar 2016 16:18
Hi.

I Used SetSpriteScale() command for decrease my character health-bar, but it decrease reverse. mean i want decrease Scale from left to right and not right to left.
I use this code :



also I used SetSpriteFlip() for fix it but problem also exists.

and this is an picture:

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 16th Mar 2016 17:53 Edited at: 16th Mar 2016 17:56
OK, I find it.

1- I should Use SetSpriteOffset(E_HealthBarSpr,0,0) for set offset to top-left corner.
2- then I Use SetSpriteScaleByOffset()
3-then Use SetSpriteFlip(E_HealthBarSpr,1,0)

JohnnyMeek
11
Years of Service
User Offline
Joined: 23rd Apr 2013
Location: Slovenia
Posted: 17th Mar 2016 08:17
It's better to use SetSpriteScissor for something like this.

Here's my routine for a loading bar. You can couple this to a tween and get some nice movement too.

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 17th Mar 2016 22:16
Thanks JohnnyMeek

Login to post a reply

Server time is: 2024-09-29 13:34:17
Your offset time is: 2024-09-29 13:34:17