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 / Render using MASK - any suggestions?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 31st Oct 2016 13:30
I want to render some animation (sprites, particles etc.) on game buttons or logo and everything that does not fit into the mask(silhouette) should be cropped.
What can I do?
Thanks
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Oct 2016 13:49 Edited at: 31st Oct 2016 13:51
hmm, you can prepare the anim images with SetImageMask at alpha channel
or as rectangle using SetSpriteScissor ( iSpriteIndex, x, y, x2, y2 ) SetScissor ( x, y, x2, y2 )
maybe also useful is DrawSprite( iSpriteIndex ) in this combination
update particels in time steps with this command UpdateParticles
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 31st Oct 2016 14:09
I think you don't understand what I want Markus...
Imagine if you want to make some particles right on TEXT! Croping using Scissor it's not the way for this...
I was thinking about the SetRenderToImage with black transparent key, but it's not that easy to fit this on the sprites...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Oct 2016 16:24 Edited at: 31st Oct 2016 16:26
ah you mean render on the text itself, i will see if me can made an example.
i have a plan
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 31st Oct 2016 17:13
Cool
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 31st Oct 2016 19:53
hmm, something to play with, don't know if it is what you can use but sprites or particles appear inside a text.
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Attachments

Login to view attachments
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 31st Oct 2016 23:56
Wow! It is very cool! Thank a lot Markus!
Unfortunately I have much more complicated situation and I've solved this by using 3d text with transparent texture... Unfortunately I was not able to use particles...
AGK doesn't have simple ways for such a complex things...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Nov 2016 01:04
can you post a pic of what you are doing or had done with this 3d text?
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Nov 2016 08:24
Similar to what Markus has done, you can put a sprite behind the button, and also use SetSpriteScissor to contain it within the button size. Use Sprite UVs to move the texture.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 1st Nov 2016 13:46
Markus,
Unfortunately I can't until the game is not done. But I promise I will show you as soon as possible!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 1st Nov 2016 16:46
I found some info in the forums on using masks: https://forum.thegamecreators.com/thread/204393

I've had good success with multi-layered alpha pngs - although there is a performance hit with some devices when using lots of alpha layers.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Login to post a reply

Server time is: 2024-09-29 19:19:09
Your offset time is: 2024-09-29 19:19:09