Text object questions

Post » Fri Feb 17, 2017 7:54 pm

Will the new text object and form element objects still be rendered as "floating" on to of the layout?

Will the new text object support CSS styling and effects?
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Fri Feb 17, 2017 9:18 pm

The text object isn't floating above the canvas in C2 or C3 - it renders like a sprite. TextBox (the text input control) is a form control so does float above the canvas.

The text object also renders in the canvas so is not a DOM element and therefore cannot be styled with CSS, in the same way you can't style a sprite with CSS.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,681

Post » Sun Feb 19, 2017 3:41 am

Thanks for the clarification!

I think the main thing I'm missing is being able to clip the form elements with blend modes to make scrolling menu items within windows/frames in the game. Too bad that seems like it will still be a limitation down the line.
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Wed Apr 05, 2017 6:26 pm

Sorry for bringing this up again @Ashley, but I wanted to confirm if this was not possible at all or if there was any way to render the css obect and then place it in the canvas (before I make a post to the suggestion page for something that can't be done).
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681

Post » Wed Apr 05, 2017 7:09 pm

No, it's not possible, anything rendered inside the canvas cannot be styled with CSS.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,681

Post » Wed Apr 05, 2017 8:26 pm

I guess it's possible to put the html/css inside an svg file and draw that to the canvas. I found a library that does it but I was only able to use it in Chrome. Didn't test Firefox. Edge and Internet explorer can't do it.
https://developer.mozilla.org/en-US/doc ... o_a_canvas
http://cburgmer.github.io/rasterizeHTML.js/
https://www.dropbox.com/s/s6i82scb1txn1 ... .capx?dl=0
B
92
S
32
G
110
Posts: 5,298
Reputation: 71,507

Post » Wed Apr 05, 2017 8:36 pm

http://htmlgl.com/

I found this, don't know if this can help. ? not sure how it works really, but there is githoob link.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 992
Reputation: 12,656

Post » Wed Apr 05, 2017 8:49 pm

I think we just need to find the best method to get svg to work with webgl, and go from there.
Decide what features are a must have, and what can be left out.
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

Post » Wed Apr 05, 2017 9:20 pm

I think this could also be applied to inline styling of text? That is a commonly requested feature as well.
Mistakes were made.
B
52
S
26
G
111
Posts: 1,630
Reputation: 62,681


Return to General Discussion

Who is online

Users browsing this forum: maranpis and 5 guests