drawing polygons like sprite object

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Sun Feb 20, 2011 8:41 am

I've been trying to extract what I need from the sprite plugin, but nothing seems to work
I tried something as simple as:

renderer->setTexture(image);
renderer->Quad_xywh(50,50,100, 100);

and that doesn't work
I also tried copypasting renderdistorted(...)
but using my own distortion values, and nothing I draw renders anything to screen at all



let's say I just want to draw a triangle at 3 points(x,y,u,v),
p1,p2,p3
and I have TextureHandle image;

what do I need to do? bare minimum to get a triangle on screen,
any help would be appreciated
if it matters for now, I'm getting image by :
:
param[0].GetParamFirstInstance(pRuntime)->info.CurTexture
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Sun Feb 20, 2011 9:24 pm

Are you checking 'image' is not null? Otherwise AFAIK it'll just draw a white solid fill box. SetTexture and a Quad are all you need to get a texture on the screen though.

(Note you should always check for NULLs - don't assume GetParamFirstInstance returns an instance - what if there are no instances?)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests