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

Problem with setting width and height of a background #70

Closed
Dokmak opened this issue Apr 14, 2013 · 7 comments
Closed

Problem with setting width and height of a background #70

Dokmak opened this issue Apr 14, 2013 · 7 comments

Comments

@Dokmak
Copy link

Dokmak commented Apr 14, 2013

Hello guys [Urgent 2]

Setting the width and height of an image sprite as a background using

var background = PIXI.Sprite.FromImage('someurl');

then setting the width and height using

background.width = 800;
background.height = 600;

it sometimes works correctly ... and sometimes it doesn't work at all ... do I have to use the assets loader class and import image data with json ? like the image url , the width and height , position ?

Or there is some turnaround that could be done ? :)

Thanks :) 👍

@GoodBoyDigital
Copy link
Member

Thanks for the heads up @Dokmak!

The issue happens when the sprites width and height are being set before the texture has loaded. I just updated pixi.js so that it should behave a little better for ya :)

Let me know if the update fixes your issue!

Thanks!

@Dokmak
Copy link
Author

Dokmak commented Apr 14, 2013

You mean I can now use the above code sample normally ?

I thought that you could maybe do a setter and a getter for the width and height ?

@Dokmak
Copy link
Author

Dokmak commented Apr 14, 2013

Still the same actually ... it displays it correctly on chrome once ... and twice or three times with the default image size.

I'll try and find a way to fix it as well :)

@GoodBoyDigital
Copy link
Member

Interesting.. I implemented a fix suggested a little while age here: #29
Do you have a link to your example at all? thanks!

@Dokmak
Copy link
Author

Dokmak commented Apr 14, 2013

Yep sure ... but please email me : mdokmak92@yahoo.com

@GoodBoyDigital
Copy link
Member

All sorted :)

@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