PhaserEditor2D / PhaserEditor2D-v3

A web-based IDE for HTML5 game development. Powered by Phaser.
https://phasereditor2d.com
MIT License
435 stars 62 forks source link

show actual amount of pixels on screen of selected objects somewhere #76

Open mikestonecodes opened 4 years ago

mikestonecodes commented 4 years ago

I have certain images that can be configured on a backend that feed into phaser, this works by replacing what file gets loaded into the cache before the game starts ( during preload step ) . it will override texture keys with whatever is set ( url etc ) . I made a user component called autoResize, but I would like a way to copy the width and height after the transformation . so for example in the image has scale set to 0.2 0.2. The original image is 223 x 223 , so I should be able to see somewhere this is 44 x 44 ( 223 x 0.2 ) . this way I can copy 44 x 44 into my component to make sure the image is correctly sized if another image is loaded that is not 223 x 223. open to other ways to do this. image

PhaserEditor2D commented 4 years ago

Hi,

Do you mean this:

image

PhaserEditor2D commented 4 years ago

Or do you mean to show the Display Width and Display Height in the Transform section?

image

mikestonecodes commented 4 years ago

yes showing the Display width and Display Height would fix it . but it would be nice to have total width and height of all selected items

PhaserEditor2D commented 4 years ago

How can we compute the total width and height?

For example, if two overlapping objects have a size of 100x100, does it show as total size 100x100 (remember both objects are overlapping)? Or 200x200, that is the total of the sizes?

mikestonecodes commented 4 years ago

Its the amount of pixels from top left of the object to the bottom right of whatever is drawn on the screen ( including rotation scale of each item ). This is how width and height of groups ( maybe containers also ) are calculated. that might be a bit complicated, just displaying the display width and display height for one object is probably good.

PhaserEditor2D commented 4 years ago

Yes, we can start by showing the size of a single object because multiple objects have some problematic edge cases.