Scripts / SetSpriteOffset clarification

Author
Message
brco900033
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 22nd Jul 2014
Location: Belgium
Posted: 14th Jun 2016 11:24
I have a question regarding the command SetSpriteOffset. I really don't know how to use it. For example a 230x130 image, I want to set the offset in the bottom-left corner.

How would I do this?
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 14th Jun 2016 16:59
All sprite values are specified as % of screen, so if you set the sprite size to 10 then the bottom left corner should in theory be 0,10.

In practice I just tend to throw values in, test it then adjust and test again.

Also be aware that you need to account for the aspect ratio of the screen when positioning sprites relative to each other.
Been there, done that, got all the T-Shirts!
PM
brco900033
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 22nd Jul 2014
Location: Belgium
Posted: 14th Jun 2016 18:04
I don't specify my sprite sizes, so in my example bottom-left corner should be 0,100, right? Or 0,130?

I tested a lot of values, but I can not seem to find any consistency. Maybe I should try setting the sprite size first...
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 14th Jun 2016 18:40
I'm using:



Of course also, SetSpritePosition and so on. I just add "CreateSprite", so you know what "myImage" is.
I'm not using size, and it is positioning fine.
Probably does not the coordinates you are looking for, but it is a good start point, now play with, to fit yours needs.
Most likely you'll need 100 to get bottom left, honestly does not test, since I just need 0 to fit my needs.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM

Login to post a reply

Server time is: 2024-12-22 18:27:44
Your offset time is: 2024-12-22 18:27:44