fengFanYong Posted November 12, 2016 Share Posted November 12, 2016 can i Local refresh,i use renderer.render(),it canvas.clear(0,0,canvas.width,canvas.height),it not i want. Thank! Quote Link to comment Share on other sites More sharing options...
themoonrat Posted November 12, 2016 Share Posted November 12, 2016 When creating the renderer, as part of the options you can pass through, make sure these are set clearBeforeRender: false preserveDrawingBuffer: true Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted November 14, 2016 Author Share Posted November 14, 2016 i want to achieve partial refres,hope can clear a sprite or graphics Quote Link to comment Share on other sites More sharing options...
xerver Posted November 14, 2016 Share Posted November 14, 2016 Render the parts you want to render separately to a render texture, and update that only when necessary Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted November 15, 2016 Author Share Posted November 15, 2016 When a sprite move ,i want clear the old sprite ,and render the new sprite Quote Link to comment Share on other sites More sharing options...
xerver Posted November 15, 2016 Share Posted November 15, 2016 You can't clear a single element of the canvas, after rendering it is just a flat bitmap. If you have parts that change rarely, you can put those in a render texture and not update it every loop. Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted November 18, 2016 Author Share Posted November 18, 2016 sorry ,i do not know your mean,i know can't clear a single elemen,i want clear the area of sprite,can your get give a demo? Quote Link to comment Share on other sites More sharing options...
xerver Posted November 18, 2016 Share Posted November 18, 2016 You cannot "clear" something off the canvas. You can only clear the entire thing, and render again. Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted November 21, 2016 Author Share Posted November 21, 2016 I do not clear something off the canvas, i want only clear the area of sprite,but when i use render.context.clear(),it will clear area of last render element.this clear different from clear of html5. 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.