Jump to content

Can someone say how i archieve this Effects in Pixi ?


Markus
 Share

Recommended Posts

Hey Kuboid,

 

thx for your Approach.

 

My Goal was it to use the DrawCircle Method.

 

But i think pixi.js has no support for gradient Fill Style.

 



//Time for some colors
var gradient = ctx.createRadialGradient(p.x, p.y, 1, p.x, p.y, p.radius);
gradient.addColorStop(0, "white");
gradient.addColorStop(0.1, "blue");
gradient.addColorStop(0.6, p.color);
gradient.addColorStop(1, "black");



 


 

 

I looked in the PIXI.GRAPHICS.JS and there is only Support 4 Color Fill.

 

Then i have to wait :-) and use a Sprite Graphic Approach.

Link to comment
Share on other sites

@Markus : you can try my PIXI hack and draw what you want as usual with the classic canvas2D context, then cache the result : http://www.html5gamedevs.com/topic/518-hack-making-all-2d-drawing-functions-available-to-pixi/

 

Less of a "hack" and more of "using the API as designed". I've been using custom shape textures by drawing on canvas for a while now (well before PIXI.Graphics), that is why Texture.fromCanvas() is there :)

Link to comment
Share on other sites

Less of a "hack" and more of "using the API as designed". I've been using custom shape textures by drawing on canvas for a while now (well before PIXI.Graphics), that is why Texture.fromCanvas() is there :)

Hmm .. Can you give me an Example how i use the Texture.fromCanvas Method ?

Link to comment
Share on other sites

Draw on a canvas, then use Texture.fromCanvas() to create a texture out of it and apply it to a sprite, just as you would any other texture. Ezelia's link is a great example of using the fromCanvas method.

 

Oh yes :-) i didnt read it carefully :-).

 

Update: I Tried this and i came to the decision to use Graphics :-). Thx 4 your time !

I only have to figure out why the fps going down @ > 270 Graphic Objects.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...