Is it possible to apply rotate3d in Behavior?

For developers using the Construct 2 Javascript SDK

Post » Tue Aug 28, 2012 7:28 am

So I'm trying to do something like this:

this.inst.cur_animation.frames[this.inst.cur_frame].texture_img.style.webkitTransform = "rotate3d(0, 0, 1, 30deg)";

Which, in theory, should give the current frame a 3d-like special effect. The problem is that... its not working at all. So far the "style.webkitTransform" is not doing what it suppose to do...

Does Anyone has any idea how to work with webkitTransform?
B
7
S
2
G
1
Posts: 18
Reputation: 1,340

Post » Tue Aug 28, 2012 1:27 pm

You cannot use CSS transforms with Construct 2 games, unless you apply them to the entire canvas. C2 does not render with CSS (it uses either canvas 2D or WebGL), which you cannot apply CSS effects to.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Wed Aug 29, 2012 1:15 am

So if I want to do a transformation, I'll need to do it in a plugin inside the draw function? Something like:

ctx.setTransform(0,0,0,0,0,0)

Will something like this work in C2?
B
7
S
2
G
1
Posts: 18
Reputation: 1,340


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests