Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderTexture.render ignoring position for Sprite #141

Closed
floatdrop opened this issue May 24, 2013 · 3 comments
Closed

RenderTexture.render ignoring position for Sprite #141

floatdrop opened this issue May 24, 2013 · 3 comments

Comments

@floatdrop
Copy link
Contributor

Hi all! I testing new RenderTexturefunctionality for my TiledMap class and stumbled on this: is RenderTexture.render ignoring position (and rotation) properties? I wrote modified example based on pixi.js example 11: http://pastebin.com/nDnLJKCT
May be I missing something in RenderTexture usage? Also RenderTexture.render does calculations for DisplayObjectContainer:

    var t = PIXI.Sprite.fromImage("spinObj_01.png");
    t.position.x = 800/2;
    t.position.y = 600/2;
    t.anchor.x = 0.5;
    t.anchor.y = 0.5;

    var o = new PIXI.DisplayObjectContainer();
    o.addChild(t);

    function animate() {
        requestAnimFrame(animate);
        t.rotation += 0.01;
        renderTexture.render(t, false); // Left up
        renderTexture.render(o, false); // Center
        renderer.render(stage);
    }

Thanks!

@GoodBoyDigital
Copy link
Member

Hi @floatdrop

Yes this is expected behaviour for rendering an displayObject to a texture. Although I think you should have the ability to choose where to render the object on the texture.

maybe we can add a few extra parameters into the render function to allow a position? eg:

var positionX = 10;
var positionY = 100
renderTexture.render(t, positionX, positionY, false);

let me know what ya think!

@floatdrop
Copy link
Contributor Author

Hi @GoodBoyDigital! Nah, it's fine, but it should be mentioned in documentation.

GoodBoyDigital added a commit that referenced this issue May 26, 2013
Improve documentation. closes #141 and #142
@lock
Copy link

lock bot commented Feb 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants