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 / BUG ? SetObjectUVOffset()

Author
Message
Blendman
9
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 17th Apr 2023 12:53 Edited at: 17th Apr 2023 12:55
Hi

This code works fine in AGK2 and doesn't work with AppGameKit studio :



Any Idea to work in studio ?

thanks


Images :
https://opengameart.org/sites/default/files/Explosion03.png
AGK2 tier1 - http://www.dracaena-studio.com

Attachments

Login to view attachments
SFSW
20
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 17th Apr 2023 15:28
IIRC, there were some quirks/flaws with the original AGK/C UV system that caused some strange value alignments. AGK/S has been corrected and for your routine to work, you'd just need to step your 'a' and 'b' values by the same division you applied to the UV scaling factor. So change this line:



To this:



So you want to step by the original offset range, not by entire integer levels.
Virtual Nomad
Moderator
17
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Apr 2023 15:42 Edited at: 17th Apr 2023 15:49
was going to suggest SetObjectUVOffset(n,0,a/4.0,b/4.0) as well which then breaks it when running in Classic.

and, i tried #Renderer "Basic" before playing with the code to no avail?

you can also just use subimages and simply "play" each to the plane via SetObjectImage() and not mess with the UV.

meanwhile, why:
SetObjectTransparency(n, 2)
vs
SetObjectTransparency(n, 1)

preference, i suppose
Blendman
9
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 17th Apr 2023 16:47
Hi

thank you very much for your help , it works !

Quote: "you can also just use subimages and simply "play" each to the plane via SetObjectImage() and not mess with the UV."

I don't knwo how to do thaht.
I have to reload the image with loadsubimage each change of the animation ?

Quote: "meanwhile, why:
SetObjectTransparency(n, 2)
vs
SetObjectTransparency(n, 1)

preference, i suppose"

In fact, it's for the fx of my game, so additive blendmode is great for fx
AGK2 tier1 - http://www.dracaena-studio.com
SFSW
20
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 17th Apr 2023 17:26
If loadsubimage is a bit too complicated or you want to support variable image sizes (for options like custom detail settings), consider just loading individual images into individual indexes and apply them as needed.

You can also apply a softer additive effect with less bleach/wash out:

SetObjectTransparency(n,3):SetObjectBlendModes(n,1,7)

Or even inverse transparency for a shadow/dimming effect for details like smoke using a separate image set:

SetObjectTransparency(n,3):SetObjectBlendModes(n,8,10)
Virtual Nomad
Moderator
17
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Apr 2023 17:43 Edited at: 17th Apr 2023 17:44
what SFSW said, or:

they all work so whatever you're comfortable with but if you want to offer code that would work on both Classic & Studio, it seems updating via SetObjectImage( Plane, Boom[Frame], 0 ) would be the way to go.
files attached.

Attachments

Login to view attachments
Blendman
9
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 18th Apr 2023 17:30
HI

Thank you very much for your answers !
It will help me a lot

SFSW ; I haven't see that we could changed the blendmode in 3D . Thanks

And thanks Virtual normad : your exemple is very interesting for billboard animated.
AGK2 tier1 - http://www.dracaena-studio.com

Login to post a reply

Server time is: 2023-06-06 14:44:41
Your offset time is: 2023-06-06 14:44:41