Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

Drawing Images onto a PIXI.Graphics obj

$
0
0

Hey guys!

 

I've got one main question, with a few follow ups.. here goes :)

 

I was wondering if there was a way draw an image onto the PIXI.Graphics (object thingy)?

I'm aware I can add sprites to the stage and other containers. But I'm currently drawing polygons, and images (with a dynamic render order), So this seems like a good way to do that.

 

 

Is there a way of doing this, similar to the plain/vanilla canvas way:

var canvas = Dom.get('canvas');var context = canvas.getContext('2d');context.drawImage(source, x, y, w, h, ...);
 I've tried:
 var context = pixiRenderer.context;

.. but this only returns the following: CanvasRenderingContext2D {}

 

And now for the follow ups:

Is the context (2d), unique to the Canvas? Would drawing imaged to the graphics object limit me to the CanvasRenderer, or could I still use PIXI.autoDetectRenderer and PIXI.WebGLRenderer ?

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>