GBear Posted July 22, 2017 Share Posted July 22, 2017 hi.. i'm wondering to draw dom on canvas by pixi please give me some idea .. thx.. Quote Link to comment Share on other sites More sharing options...
xerver Posted July 23, 2017 Share Posted July 23, 2017 PIXI has no special methods for this. There are a few library's out there for doing this with Canvas 2D though. Quote Link to comment Share on other sites More sharing options...
GBear Posted July 23, 2017 Author Share Posted July 23, 2017 @xerver hi xerver. we are using only webgl on canvas ... is there any good idea to control or draw dom with pixi.js as both is same.... Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 23, 2017 Share Posted July 23, 2017 For your game I dont recommend to use DOM it at all, FPS will go down. Quote Link to comment Share on other sites More sharing options...
GBear Posted July 23, 2017 Author Share Posted July 23, 2017 40 minutes ago, ivan.popelyshev said: For your game I dont recommend to use DOM it at all, FPS will go down. @ivan.popelyshev hi ivan. this question is not for only our game. this is only for my idea. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 23, 2017 Share Posted July 23, 2017 If you want to dig into something, look at https://github.com/pixijs/pixi-ui Quote Link to comment Share on other sites More sharing options...
GBear Posted July 24, 2017 Author Share Posted July 24, 2017 23 hours ago, ivan.popelyshev said: If you want to dig into something, look at https://github.com/pixijs/pixi-ui pixi-ui have not used dom. , isn't it? is there some controller to positioning or sizing of dom with container? if i use dom, i will make domContainer. it will be control size or position as PIXI.Container.. if i couldn't find it, i will make it.. give me any idea please Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 24, 2017 Share Posted July 24, 2017 Best idea: don't do that. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted July 24, 2017 Share Posted July 24, 2017 On 23/07/2017 at 10:47 AM, ivan.popelyshev said: For your game I dont recommend to use DOM it at all, FPS will go down. I'm always alarmed by statements like this, why do you think this? Have you got any evidence where this happens? I've never really tested it but adding a DOM UI layer above a canvas has never affected my fps at all, I've never explicitly tested it though, so wondering if you had a test case or knew of one. The advantages of using the DOM to draw a largely static UI are great, and I've never noticed any FPS hit at all, have I missed something? I can't think why it would affect the FPS of the canvas element much at all. Quote Link to comment Share on other sites More sharing options...
xerver Posted July 24, 2017 Share Posted July 24, 2017 11 hours ago, GBear said: pixi-ui have not used dom. , isn't it? is there some controller to positioning or sizing of dom with container? if i use dom, i will make domContainer. it will be control size or position as PIXI.Container.. if i couldn't find it, i will make it.. give me any idea please Like I mentioned, PixiJS has no mechanism to help you with it. But you can draw DOM to a canvas, if you search for methods/libraries. For example, MDN article about it: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Drawing_DOM_objects_into_a_canvas 1 hour ago, mattstyles said: I'm always alarmed by statements like this, why do you think this? Have you got any evidence where this happens? I've never really tested it but adding a DOM UI layer above a canvas has never affected my fps at all, I've never explicitly tested it though, so wondering if you had a test case or knew of one. The advantages of using the DOM to draw a largely static UI are great, and I've never noticed any FPS hit at all, have I missed something? I can't think why it would affect the FPS of the canvas element much at all. Because if you have DOM on top of the canvas (or a transparent canvas with DOM behind it) the browser has to composite the DOM it renders with your canvas. If there is no DOM above the canvas (and the canvas isn't transparent) it can just blit your output texture, which is much faster. The performance difference exists and is measurable, however many applications won't bump into this. mattstyles and ivan.popelyshev 2 Quote Link to comment Share on other sites More sharing options...
GBear Posted July 27, 2017 Author Share Posted July 27, 2017 @xerver hi xerver. thank you for your mention.. ... we know dom is not good to draw with renderable system to make game. if UI System has huge or complex , i will be more not good. but i'm thinking to integrate game and hompage or other something... so i'm checking many functions to make good.. or useful... so i'm checking many many ideas with more specialist better than me, like you or ivan.. or mattstyle? ^^ i have to do something to go to next step.for my idea.. thx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.