Transform Graphic Objects in Units, not Scale %: HOW?



  • I'm about done with the "joys" of using the Scale facilities of the Transform Object. It's fun for a few moments, then utterly infuriating, especially when combined with the peculiarities of the "snapping" and the odd way that anchors don't work.

    How do I operate in literal units of the image/scene when editing/transforming imported graphics and their objects?

    // I'm whinging because I have used a LOT of different design software, most of which solved these problems in the late 1980's or early 1990's, at the latest.



  • @Deeeds by "units of the image/scene" I'm assuming you mean hyperPad metres. I'm not sure what problems you're having with anchors. The grid works fine for me for snapping to metres divided into powers of 2, but if you want to scale to something different like a third of a metre it gets a bit more complex.

    You can adjust the grid scale by tapping the globe at the top and changing the pixel to metre scale, but this doesn't accept decimal values. If you want to you can calculate the scales.

    A metre is 1/32 of the screen width and 1/24 of the screen height. On a 2048 by 1536 pixel image that takes up the screen, this means a metre is 64 pixels (it's actually 32 I think because hyperpad scales it down, so I'm going by size before importing). If you have an image of x pixels width, divide by 64 to get the width in metres. Then divide the target width in metres by that value and multiply by 100 to get the percentage scale you want.

    Example: you have a 100 pixel width image, but you want to have width of 2m.
    100/63=1.5625.
    2/1.5625=1.28.
    Scaling the image to 128% will bring the width to 2m.



  • @Jack8680 How do you edit the object in Metres? I only see:

    Position
    in metres

    Scale
    in X and Y percentages

    Rotation
    Degrees

    Anchor Point
    in Percentages

    Order
    Z position in positive values



  • @Deeeds that's what I'm saying, you can use the grid to scale the object to metres, or calculate the percentage scale needed based on the resolution of the image and the metres you want. Scale in metres could be a nice option though.



  • @Jack8680 Oh. I see. You've used the grid as a workaround for not having literal units based sizing. That's an interesting way to solve a problem. Colour me amazed!



  • @Deeeds wait that's actually am easier way to do it. Scale the object to 1m using the grid then multiply the scale by target size.



  • @Jack8680 What?



  • @Deeeds say you have an image and you want to get it to be one and a third metres wide. You would use the grid to scale the image down to 1 metre wide, then look at the percentage it's at and multiply that by 1.33. Going to sleep now, hope I'm not being too confusing.


  • Admin

    I'm not sure I understand the question exactly.
    But in hyperPad 1 meter = 32px (actually 32 points).
    By default the grid is at 32 px, and the snapping is based off this as well.

    You can also change this ratio in the global properties. It's under PTM, where you can make 1 meter =100 px for example.



  • @Murtaza In most every graphics editor on earth (I really can't think of an exception) editing an object's size is done in literal units, primarily. Percentage size changes are not nearly as universally useful, nor commonly used. Wherever they're offered, percentage scaling is the secondary option, not the primary option... which is literal units.

    So, let's say, I dropped in a perfectly square Sprite, measuring 100px by 100px.

    Whatever the scaling system of the engine/renderer is, that would be mapped at 100px to 100px of the engine... and might mean that it's (for example) 50pts by 50 pts, in the engine's units.

    Now, if I want to change the Square Sprite's shape, I can edit the points, so I might make it:

    100 pts by 50 pts, thereby doubling the length of one side.

    This is how every editor on earth works because all layouts are done in the literal units of the canvas upon which the work is being done, not in percentages of size relative to individual and uniquely shaped incoming objects. In other words, the canvas is king, not the entities that go onto it.

    I'm simply shocked to see scaling in percentages take priority over literal sizing by units to the extent that there are no entry points for unit editing of a shape's size/ratio. Very bizarre choice. Makes it obvious none of the developers have ever used Flash, Illustrator, Photoshop, CorelDraw, Freehand or anything else that works with images. Including Unity ;)


  • Admin

    Ahh I see.
    You want to scale an image to a specific pixel size.

    Yeah. The reason why we decided to go this route is simplicity. Most of our users never worked in graphics editor or that sort of software.

    In their minds they just want something double the size. So for these type of users 200% is more intuitive than making a 64x64 pixel image be 128x128.



  • @Murtaza Is it a pain to add arbitrary unit editing of sprites right underneath (or above) the percentage scaling feature, and make it dynamically adjust if the user adjust percentages, and (conversely) make the percentages dynamically adjust if the user edits the literal units?


  • Admin

    I'm not sure. @Hamed, how difficult is it to add this?



  • @Murtaza I've just messed around with something I need to do exactly.

    For the record, and for everyone else from the graphics world... it is 32 POINTS per metre.

    Not pixels.

    Pixels are, by default, at double that in hyperPad, 64px per metre.

    Although this can change, and will change, when targeting iPhone Plus phones against the stock size, and will also change on the iPhone X.

    So far all iPads are using a 1:2 points to pixel ratio.



  • @Deeeds I think retina devices have two pixels per point, non retina have one per point.
    It’s not some ratio that will change on normal and plus sizes I don’t think.
    @Murtaza i think you’ve explained this before? Is this correct?



  • @iTap-Development Plus sized iPhones are 3x, meaning that it's 3 pixels per point.

    Fortunately, iPhone X is also this. But truly this.

    iPhone Plus phones have a very odd scaling down to 1920 from 2208, also. Creating an ever so slight blur on everything.


  • Admin

    Yes.
    It's points not pixels (as I mentioned above).

    However, for phones and performance we actually go as far as @2x and not 3x for images. This is usually what most games with lots of moving graphics do. (it reduces memory usage).

    on importing, hyperPad assumes you're importing retina version (unless you turn the toggle off on the import popup) and will automatically create a halfsize nonretina version for you.

    Edit: Actually pretty sure you can use @3x when exporting and manually adding the images to your xcode project. @Hamed will need to confirm though.