Jump to content

How to numerically adjust the size of box and the position of its pivot?


Recommended Posts

So I guess I'm not even sure if this is possible, but is there a means of being able to adjust the height and width of a box not by reshaping it in the editor, but by adjusting some parameters in a menu somewhere. I want to be able to perfectly say a box is 30x30 for example and I don't think I'll be satisfied just eyeballing it in the editor.

 

The same goes for the pivot point. With the sprites in the folder menu you can perfectly place the pivot points, however I can't seem to find any such option for boxes made in the editor. How do you do that?

Link to post
Share on other sites

Hi Alejandro,

You can adjust the width and height of collision boxes by changing the x and y percentages in the object properties palette when you select the rectangle. but its not based on pixels, so if your goal is pixel precision it won't help you directly.  If, for some reason, you need collision rectangles to be an exact number of pixels wide or high, the fastest and most reliable method would be to create a rectangle image that size, drag it onto the canvas, and use it as a template to create your rectangle over...then delete the image version once you're finished.  You could also draw this guide image in a way to help you carefully place the pivot point of the real collision rectangle, while it's still over the guide image.

Out of curiosity, why do you need pixel accuracy for collision boxes when they are invisible and for affecting game-play? Typically rectangles and points would be placed not based on arbitrary pixels, but what is best for game-play.

cheers.
-Mike at BrashMonkey


 


 

Link to post
Share on other sites

Hello BrashAdmin,

Pixel perfection is less a necessity and more just a desirable option. I like being able to look at a box and know exactly its size pixel-wise.

Also, while I see the object properties window, it doesn't really help me with my desire to be able to set the pivot point of a box automatically to the center. Like you can sprite images.

Thanks for the response!

Link to post
Share on other sites
  • 2 weeks later...

You're probably going to have to open the SCML file and edit the "w", "h", "pivot_x", and "pivot_y" properties of the relevant "obj_info" tag, keeping in mind that the latter range from 0 to 1, and represent a fraction of the box's width or height, respectively. The exact center would, of course, be "0.5".

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...