PIXI. Circle

this will be displayed circle


This is a little example representative, i find on google .


circle.gif


I would like the plugin operates,with the Pixie engine, with radius variable.
thank you


https://pixijs.github.io/docs/PIXI.Circle.html
Look into the PIXI Graphics object, it allows you to draw shapes and may work with that.
Look into the PIXI Graphics object, it allows you to draw shapes and may work with that.

i try but no work.


is the reason i need a little plugin.


Or a example working, to help me learn.

Code:
/**
* Draw an ellipse.
*
* @method drawEllipse
* @param {Number} x The x coordinate(in bitmap) of the center of the ellipse
* @param {Number} y The y coordinate(in bitmap) of the center of the ellipse
* @param {Number} w The width of the ellipse
* @param {Number} h The height of the ellipse
* @param {Number} lw The width of the ellipse's line
* @param {String} color The color of the ellipse in CSS format
*/
Bitmap.prototype.drawEllipse = function(x, y, w, h, lw, color) {
    var context = this._context;
    var w = w * 2;
    var h = h * 2;
    var x = x - w/2;
    var y = y - h/2;
    context.save();
    context.beginPath();
    var kappa = 0.5522848,
        ox = (w / 2) * kappa, // control point offset horizontal
        oy = (h / 2) * kappa, // control point offset vertical
        xe = x + w,           // x-end
        ye = y + h,           // y-end
        xm = x + w / 2,       // x-middle
        ym = y + h / 2;       // y-middle
    context.moveTo(x, ym);
    context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    context.closePath();
    context.strokeStyle = color;
    context.lineWidth = lw;
    context.stroke();
    context.restore();
    this._setDirty();
};

/**
* Fill an ellipse.
*
* @method fillEllipse
* @param {Number} x The x coordinate(in bitmap) of the center of the ellipse
* @param {Number} y The y coordinate(in bitmap) of the center of the ellipse
* @param {Number} w The width of the ellipse
* @param {Number} h The height of the ellipse
* @param {String} color The color of the ellipse in CSS format
*/
Bitmap.prototype.fillEllipse = function(x, y, w, h, color) {
    var context = this._context;
    var w = w * 2;
    var h = h * 2;
    var x = x - w/2;
    var y = y - h/2;
    context.save();
    context.beginPath();
    var kappa = 0.5522848,
        ox = (w / 2) * kappa, // control point offset horizontal
        oy = (h / 2) * kappa, // control point offset vertical
        xe = x + w,           // x-end
        ye = y + h,           // y-end
        xm = x + w / 2,       // x-middle
        ym = y + h / 2;       // y-middle
    context.moveTo(x, ym);
    context.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
    context.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
    context.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
    context.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
    context.closePath();
    context.fillStyle = color;
    context.fill();
    context.restore();
    this._setDirty();
};
up! tanks
up! tanks
up! tanks
I'd actually done something similar to this for someone else, except what your asking for is alot simpler 😀  so I took a minute to write something up, I commented the plugin as much as i could incase you're interested in seeing how to do it yourself. 

Download

Hope this helps~
I'd actually done something similar to this for someone else, except what your asking for is alot simpler 😀  so I took a minute to write something up, I commented the plugin as much as i could incase you're interested in seeing how to do it yourself. 

Download

Hope this helps~

Tanks i lot i will study this next day , your are awesome,
If i have question i will be back


Tanks friend
I'd actually done something similar to this for someone else, except what your asking for is alot simpler 😀  so I took a minute to write something up, I commented the plugin as much as i could incase you're interested in seeing how to do it yourself. 

Download

Hope this helps~

no work , nothing draw 🙂


i try call this for testing in console.log and in the rmmv javascript call 


//var varname = new PiSprite(x, y, Rad, angle, #color);
var TestCircle = new PiSprite(100, 100, 100, 1, '#ffffff');




no error in the console.log.
Just nothing error?? and nothing draw ?


Do you have any idea ?


It suppose to draw a full white circle ?
1 = full 


and


0 = Empty


tanks


I not try with empty plugin


Do i make i mistake , or is a plugin issu and i need to find it.
That should have worked work. hmm, did you assign it as a child to the scene or another rendered sprite? try adding this line after you create the circle. 🙂

Code:
SceneManager._scene.addchild( TestCircle ); 
That should have worked work. hmm, did you assign it as a child to the scene or another rendered sprite? try adding this line after you create the circle. 🙂



SceneManager._scene.addchild( TestCircle ); 



Thanks a lot for your help.
Unfortunately, I do not get anything.
My study with the integration of PIXI are difficult for me.
There is no document in my native language, however, I intend to study it, but with examples and thanks to people like you.


If you could help me with a functional blank project for me to study
I would be happy.


I took the time to make you a blank project with your plugin and script.
I also added the console.log.
Unfortunately, even in a blank project, nothing is displayed.


You would be super nice if you could download and edited this project and send it back functional so I can study the workings.


I am very grateful for your help.


Download the project with your script here.


https://mega.nz/#!9dxHkCDS!61pznpZXZj00IVzoXgg5RNuFJXjkrSSXyQxzi7C27pk


Tanks a lot @chaucer
Ok I apologize, this was my bad, the code i gave you to use was

 


SceneManager._scene.addchild( TestCircle ); //notice addchild, the word child does not have a capital letter.



when it SHOULD have been this,
 


SceneManager._scene.addChild( TestCircle ); //notice in this one, addChild, the word Child has a capital letter.



However, in downloading the project i did notice that colors weren't working, so i went ahead and fixed that for you. 

Download here.

Original thread: https://forums.rpgmakerweb.com/threads/pixi-circle.70138/