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 Studio Chat / Merged images/text to one sprite

Author
Message
frosty45
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 29th Jul 2020 01:30
Is it possible to load 2 or 3 images and a couple of text boxes, set the positions and all that, then set it all to one sprite? I see mentions of drawing things on the back buffer but this is a bit confusing for me as I haven't seen an example for pre-loaded images.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jul 2020 01:33
First call Render()
Then GetImage()

This is not something you can do every frame
frosty45
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 29th Jul 2020 01:46
I just want to do it at a moments notice. If everything's already on the screen, that'll work? I'll give it a shot. Thank you.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jul 2020 01:52
Yes that will work. Just remember: Not every single frame
frosty45
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 29th Jul 2020 02:37
Well it's working, sort of. I get the image I want as a sprite, granted it's smaller but I can work with that. The calls for setting the sprite size and position do not work. It just stays exactly where it is no matter what I try. I only see the sprite in the corner at 0, 0. Also, some of the original sprites that are in the GetImage() area disappear for some reason.

The function below will only be called occasionally (not every frame like you say). I just want to take a snapshot of the screen so I can animate flipping the current card.

Thank you for your help so far

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Jul 2020 02:53 Edited at: 29th Jul 2020 02:54
cardfont
cardfont = CreateSprite(cardfront)

I recommend you use #option_explicit

Also remember that you will need to delete the last image when you create new ones, otherwise your memory will blow out
frosty45
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location:
Posted: 29th Jul 2020 03:30
Doh! Thank you again!

Login to post a reply

Server time is: 2024-03-28 10:28:37
Your offset time is: 2024-03-28 10:28:37