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 / Sprite Manipulation?

Author
Message
SmileSlime
6
Years of Service
User Offline
Joined: 10th May 2017
Location:
Posted: 15th Oct 2017 04:12
Hello, I wanted to know if there were advanced techniques that would manipulate sprites in a way that can change the shape of the sprite into more than just boxes. Ex: Circle, rhombus, wavy, trapezoid, etc. Including that, are there any ways to add filters to sprites? (Blur, glow, etc.)
I love games, who doesn't?
Andrew_V2.0
7
Years of Service
User Offline
Joined: 5th Dec 2016
Location:
Posted: 15th Oct 2017 16:51
I've been asking myself the same questions.
As far as I can tell, the answer is - look at the 3D commands. You could try using an image you'd normally use as a sprite, as a texture on a built-in primitive, or on a custom shape made in a 3D modeling program (Blender is awesome and free, btw). Another nice thing about AGK's 3D commands are shaders (AGK supports both sprite shaders and full screen shaders) which could be used to render glows, blurs, and distortions. I know zero about GLSL shader coding though. Maybe try Google, searching the 3D forums here, or go to https://www.opengl.org/ ?


janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Oct 2017 20:12 Edited at: 15th Oct 2017 20:16
Right the trick is to make the shapes with the 3D commands because you can't manipulate the vertices of an sprite but you have access to the vertices of 3D objects via the memblock commands.
Then you need to fake the look of the sprite with your 3D object using on orthogonal projection matrix and ignoring the 3rd dimension.
What you get is pretty much the same as a sprite internally. (Sprites also have vertices...In AppGameKit they have 4 vertices = 1 quad)

Quote: "are there any ways to add filters to sprites?"

-> Useful Community Shaders Project
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Jerry McGuire
7
Years of Service
User Offline
Joined: 25th Mar 2017
Location:
Posted: 16th Oct 2017 23:00
I think what Scraggle says is what you're looking for. The only limitation is that your polygon can have a maximum of 12 nodes or so. Also, there is a specific option for circle shape.
iMac Book Pro, MacOS 10.12.4, Xcode 9.0.1;
iPhone 6, iOS 9.35; iPhone 5s, iOS 9.35; iPad (3rd gen), iOS 9.35;

Dell Precision T7400, Windows 7 Professional 64bit, Visual Studio Community 2015;
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 16th Oct 2017 23:55
Quote: "I think what Scraggle says is what you're looking for."


SetSpriteShapePolygon sets the collision shape only, I believe the OP wants to manipulate the sprite visible image shape, in which case its go with janbo's suggestion or use SetImageMask, you would of course need to predefine some 'shape' masks for your image.
puzzler2018
User Banned
Posted: 17th Oct 2017 07:22
Or could delve yourself into learning memblocks - they are very powerful and do quite a lot of funky things with them


D

Login to post a reply

Server time is: 2024-04-20 07:25:53
Your offset time is: 2024-04-20 07:25:53