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.

Newcomers AppGameKit Corner / embed or generate media in code

Author
Message
Barmyfluid
2
Years of Service
User Offline
Joined: 20th Jul 2018
Location:
Posted: 21st Jul 2018 17:41
Hi all - is there any provision or a workaround to either embed data or generate it within AppGameKit code and then assign it to a sprite rather than loading it from an external image? Same for sound, any way of generating it from the waveform up? Hacky solutions welcome

bx
TomToad
2
Years of Service
User Offline
Joined: 6th Jan 2018
Location:
Posted: 22nd Jul 2018 12:05
CreateRenderImage() will create an image you can render to. SetRenderToImage() to begin rendering to that image. Now all the draw commands go to the image instead of the screen. When done, use SetRenderToScreen() to return rendering to normal. Now the image can be assigned to a sprite and drawn as normal. CreateImageFromMemblock() if you wish to draw to the image at the pixel level.

CreateSoundFromMemblock() for creating your own sounds in code.
Barmyfluid
2
Years of Service
User Offline
Joined: 20th Jul 2018
Location:
Posted: 22nd Jul 2018 17:09
*Skwee!!!*

Thank you very much

Just finding my way around, stellar amount of commands and functionality.

bx
MadTinkerer
9
Years of Service
User Offline
Joined: 21st Nov 2010
Location:
Posted: 3rd Aug 2018 22:36
There's also a good tutorial in Official Tutorial Guide 2 about making sprites from scratch for menu buttons. It actually doesn't use CreateRenderImage, but instead CreateSprite. Both methods work.

Login to post a reply

Server time is: 2020-10-21 00:18:57
Your offset time is: 2020-10-21 00:18:57