Text Z Order problem [Chrome]

Forum Home Forum Home > Construct 2 Development > Bugs > Closed bugs
 Post Reply Post Reply
Author
2,775 Rep
Post Options Post Options   Quote Guif0DA Quote  Post ReplyReply Direct Link To This Post Topic: Text Z Order problem [Chrome]
    Posted: 01 Apr 2012 at 8:48pm
Hey

I made a text object at layer 0, layer 1 have some sprites.

when the sprites move to the text, the text object is above then, should be below.

In Internet Explorer 9 it's showing correctly it's Z order position.

Also the Text object at the same layer as the sprite object, if I put it behind the sprite and run the preview it appear above the sprite too.

Tested only in IE9 and Chrome (latest version)

Using C2 R84 64bit.


EDIT: WebGL disabled with Chrome the problem doesn't appear, the text Z order is correct. Maybe something related to my video card? Can some1 try that with Chrome and webgl enabled with a dedicated video card and see if this problem persist?

Edited by Guif0DA - 01 Apr 2012 at 8:51pm
Back to Top
3,638 Rep
Post Options Post Options   Quote Erndog2k Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 2012 at 10:44pm
I also have this problem with text not going anywhere but top of everything. It's also Firefox too that does it also.
Back to Top

Scirra Developer
78,275 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 2012 at 11:04pm
This is not a bug, it's by design. See the manual entry for Text:

Quote Note if WebGL is enabled in project properties, due to technical limitations all Text objects appear on top of everything else in the game. For example, Sprites cannot be displayed on top of Text objects when WebGL is on, because the text is rendered to an overlay above the game. It is recommended to design your game so it is not necessary for other objects to appear on top of text objects, since turning off WebGL can reduce performance.


IE9 does not support WebGL, which is why it Z orders as you expect.
Back to Top
2,775 Rep
Post Options Post Options   Quote Guif0DA Quote  Post ReplyReply Direct Link To This Post Posted: 02 Apr 2012 at 12:07am
Originally posted by Ashley Ashley wrote:

This is not a bug, it's by design. See the manual entry for Text:

Quote Note if WebGL is enabled in project properties, due to technical limitations all Text objects appear on top of everything else in the game. For example, Sprites cannot be displayed on top of Text objects when WebGL is on, because the text is rendered to an overlay above the game. It is recommended to design your game so it is not necessary for other objects to appear on top of text objects, since turning off WebGL can reduce performance.


IE9 does not support WebGL, which is why it Z orders as you expect.


but how could this be a design choice?
I turn on webGL because it make the game faster but then I can't make the game like I want because there will be texts everywhere above things I don't want to be..
This technical limitation if from the browsers or C2 itself?
Back to Top

Moderator
28,490 Rep
Post Options Post Options   Quote Kyatric Quote  Post ReplyReply Direct Link To This Post Posted: 02 Apr 2012 at 2:16pm
WebGL does not render text, so to have text, Ashley is forced to display them in an other DOM element on top of the canvas.
Back to Top

Scirra Developer
78,275 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 02 Apr 2012 at 2:49pm
@Kyatric is right, WebGL does not actually have the ability to draw text. So we work around this by having text layered on top of the WebGL canvas.

You can work around it if you put your text in Sprites or use the Sprite Font plugin - any way you can make your text appear without using the Text object should work.
Back to Top
2,775 Rep
Post Options Post Options   Quote Guif0DA Quote  Post ReplyReply Direct Link To This Post Posted: 03 Apr 2012 at 12:12am
Originally posted by Ashley Ashley wrote:

@Kyatric is right, WebGL does not actually have the ability to draw text. So we work around this by having text layered on top of the WebGL canvas.

You can work around it if you put your text in Sprites or use the Sprite Font plugin - any way you can make your text appear without using the Text object should work.
Ya i have thinked about that.. maybe add them to sprites.. also I could add some nice effects to them..

Thanks by the way ;)
Back to Top
5,545 Rep
Post Options Post Options   Quote Ugotsta Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 2012 at 3:36am
This can actually be achieved with R0J0hound's Canvas plugin, by pasting a Text object onto a Canvas, at which point you can then utilize other effects, opacities, etc.

If needed, you can also clear the canvas and rewrite text object, should any texts need changing.

Here's a quick demonstration: DEMO

Here's the capx:logo-fade-swipe.capx
Check out Nibble in the HBGames Build and Win Construct 2 Contest!
Back to Top
2,775 Rep
Post Options Post Options   Quote Guif0DA Quote  Post ReplyReply Direct Link To This Post Posted: 17 Apr 2012 at 4:48am
Originally posted by Ugotsta Ugotsta wrote:

This can actually be achieved with R0J0hound's Canvas plugin, by pasting a Text object onto a Canvas, at which point you can then utilize other effects, opacities, etc.

If needed, you can also clear the canvas and rewrite text object, should any texts need changing.

Here's a quick demonstration: DEMO

Here's the capx:logo-fade-swipe.capx
Nice demo! ill take a look at the plugin, thanks for the tip ;)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down