wiseguy12851 Posted October 10, 2014 Share Posted October 10, 2014 Hi Im very new to Phaser but I'm looking to take the final render output on each frame and pipe it through a simple pixel process function before showing the final rendered output. I'm wanting to do this for every frame, the resolution will be fairly low and the function will be pretty simple and quick so it shouldn't have any lag. Thank You Link to comment Share on other sites More sharing options...
rich Posted October 10, 2014 Share Posted October 10, 2014 Just create a 'render' method and then manipulate the context as needed. Render is run post-render. Link to comment Share on other sites More sharing options...
wiseguy12851 Posted October 11, 2014 Author Share Posted October 11, 2014 But how do I obtain the final rendered image in the post-render render method. Which class and property has the image about to be shown? I've searched through the various classes in the API and haven't found anything yet. Link to comment Share on other sites More sharing options...
rich Posted October 11, 2014 Share Posted October 11, 2014 game.context Link to comment Share on other sites More sharing options...
wiseguy12851 Posted October 11, 2014 Author Share Posted October 11, 2014 Thanks, I was looking for a complete Phaser approach where I would somehow get the final rendered image into a bitmapdata object and manipulate the pixels through phaser's API - but I like the context approach because its less function calls and loading / creating data meaning less overhead on each frame rendering Link to comment Share on other sites More sharing options...
rich Posted October 11, 2014 Share Posted October 11, 2014 Nope, Phaser is done with it by that point. At that point it's all on the context waiting to be drawn to the screen. Link to comment Share on other sites More sharing options...
rich Posted October 11, 2014 Share Posted October 11, 2014 Having said that, you could easily create a BitmapData that pointed to the game.context. You could then use all of the methods it offers directly on it. Depends what you need to do really. Link to comment Share on other sites More sharing options...
wiseguy12851 Posted February 17, 2015 Author Share Posted February 17, 2015 Sorry to revive an old thread but I've come back to this issue because I I more or less created a workaround which just got problematic and messy. I noticed there was a postRender method metnioned in the API docs but no information or link was given to it so this leaves me a bit confused and I'm taking a guess that the render method is meant for any postRender manipulation before postRender is called which I asusme is when it displays the rendered output and gives a chance to do something after its been called, although I cant find anywhere to configm that. Essentially what I'm trying to do is make the final output fit within a 4-color palette that can whimsically be changed. Any help with this would be great, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts