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 / [SOLVED] GetTextSize but no getspritesize

Author
Message
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 9th Nov 2022 19:40
So i am playing tweens and I can play my tween text to ease out with gettextsize

but I can not get the size of sprites so i can not play them together with the same ease out.

SetTweenSpriteSizeX( PopUpTweenID, getspritesize,getspritesize, TweenEaseOut1())
SetTweenSpriteSizeY( PopUpTweenID, getspritesize, getspritesize, TweenEaseOut1())

The author of this post has marked a post as an answer.

Go to answer

Dark Raven
10
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 9th Nov 2022 20:31
I believe sprite size is actually gotten via two functions GetSpriteWidth and GetSpriteHeight while GetTextSize gets the height of each character according to help site.
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 9th Nov 2022 22:49
So GetSpriteHeight is your answer?

Dark Raven
10
Years of Service
User Offline
Joined: 27th Jul 2014
Location: United States
Posted: 10th Nov 2022 02:09
This post has been marked by the post author as the answer.
Please understand before reading on that I'm not a tween expert so hopefully what I'm describing is understandable. I did simple test before writing
but I'm no expert.

The size X is for the width of sprite
The size Y is for the height of the sprite.

The values used in the tween function are the start size and the end size.
So for the size X you would set the start width and the end width
so for the size Y you would set the start height and the end height.

Just remember that these start and end value are for the tween container.
They do not affect the actual sprite width and height except for what is visually displayed.
So if you do a GetSpriteWidth() and GetSpriteHeight() after the tween you will get the size of the sprite when it was created.

Usually you want the sprite start width and sprite start height to be what your initial sprites width and height and either decrease or increase the end width and end height values.
But you may also want to call SetSpriteWidth and SetSpriteHeight after the tween is done to set the actual spritesize to the end width and end height size or GetSpriteWidth and GetSpriteHeight
will return the initial sprite size and that may cause problems in the future.
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 10th Nov 2022 04:30
Ok lol I get what you are saying, let me try this and i will let you know.
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 10th Nov 2022 04:38
Ok it worked, this is what I did, easy really, thanks.

Login to post a reply

Server time is: 2024-11-23 08:23:12
Your offset time is: 2024-11-23 08:23:12