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 / thin sprite displays incorrectly

Author
Message
greycheek
8
Years of Service
User Offline
Joined: 13th Mar 2016
Location:
Posted: 31st Aug 2016 12:44
I am using a sprite 2 pixels wide by 30 high as a means of displaying the health of unit in my game. Often and for no apparent reason the sprite will display cut in half to only 1 pixel wide. Has anyone experienced this kind of thing?
I've tried using SetSpriteSnap() but that has no effect.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Aug 2016 13:17
It will also depend on your screen resolution. You should set the width in code according to your virtual resolution units, rather than rely on the original image dimensions.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
greycheek
8
Years of Service
User Offline
Joined: 13th Mar 2016
Location:
Posted: 31st Aug 2016 17:45
I have the following code:



How do I set the width according to the virtual resolution units as you suggest? BTW, even though the resolution and window size match my development display size, the app window doesn't take up the entire screen. Don't know why.

Login to post a reply

Server time is: 2024-09-29 17:28:03
Your offset time is: 2024-09-29 17:28:03