phoboslab / Ejecta

A Fast, Open Source JavaScript, Canvas & Audio Implementation for iOS
2.81k stars 322 forks source link

include a CSS #328

Closed fobetor closed 10 years ago

fobetor commented 10 years ago

Hello, I'm trying to use a webgl library that uses some CSS files to render elements on the canvas, so it relies on them. I have searched the documentation and issues, but, escuse me, I was not able to finde how to include/import a CSS file on to ejecta... Is it possible to do so? Thank you Fernando

phoboslab commented 10 years ago

Ejecta doesn't understand CSS or HTML.

uses some CSS files to render elements on the canvas

How so? You mean "on top of" the Canvas? That's not possible in Ejecta. You have to draw everything "inside" the Canvas.

fobetor commented 10 years ago

Thanks, Dominic, Yes, I know that ejecta does not use CSS, but some webgl libraries uses them to render elements to the canvas. Thats what I mean. I dont know if I am expressing it correctly. Since I am not a avenue programmer, perhaps I am missing something. But what I see, is that sometimes, some libraries uses some CSS styles to render the elements to the canvas. If the CSS can not be read, the elements cant be rendered. Isnt it correct? so... If the CSS applies to the WebGl javascript library... is there a way of including the CSS?

phoboslab commented 10 years ago

Canvas2D/WebGL doesn't understand CSS either. You can't use CSS/HTML to render anything on the Canvas; you can only have some HTML elements on top of the Canvas.

some libraries uses some CSS styles to render the elements to the canvas.

Can you show an example of what you mean?

fobetor commented 10 years ago

for example: http://threejs.org/examples/#css3d_panorama ?¿

weepy commented 10 years ago

Isn't that just a CSS renderer for Three ? I.e. it leverages CSS rather than webgl or canvas.

On Tue, Feb 18, 2014 at 12:12 PM, fobetor notifications@github.com wrote:

for example: http://threejs.org/examples/#css3d_panorama ?¿

Reply to this email directly or view it on GitHubhttps://github.com/phoboslab/Ejecta/issues/328#issuecomment-35378125 .

fobetor commented 10 years ago

Yes... testing to have two option when rendering in three js through ejecta...Strange, I know.. but asking....

weepy commented 10 years ago

Ejecta doesn't have any knowledge of CSS - so you can't do I'm afraid.

On Tue, Feb 18, 2014 at 12:19 PM, fobetor notifications@github.com wrote:

Yes... testing to have two option when rendering in three js through ejecta...Strange, I know.. but asking....

Reply to this email directly or view it on GitHubhttps://github.com/phoboslab/Ejecta/issues/328#issuecomment-35378702 .

phoboslab commented 10 years ago

If you want to use ThreeJS use its WebGL renderer. The Canvas2D renderer works too, but is much slower. The CSS3D renderer is not supported, because Ejecta doesn't support HTML or CSS.

fobetor commented 10 years ago

Ok thank you very much.