User Tag List

Results 1 to 2 of 2

Thread: GridSnap Object Idea

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Posts
    2,289
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    GridSnap Object Idea

    I encourage everyone to lay out out good ideas for unique extensions, just in case the devs are looking for inspiration.

    One that I thought would be useful would be the GridSnap Object. It would be somewhat similar to EZGrid, but easier to use and more for applications and positioning.

    Basically, it would have similar settings to EZGrid, but you would eb able to set any object ot "snap" a object to the grid when dropping it. It would allow us to use a grid during runtime just like like we do during edittime on the frame.

    As per my example, using EZGrid becomes rather involved for this purpose, (and really needs an update and some streamling itself) so I would like this object to be able to work in a more straight forward way with less setting and convoluted expressions. Ideally, you would be able to either set objects to the grid object and have any object snap when an action is evoked:

    On mouse up, (object dropped) snap Active to grid. Done!

    Ideally, it would allow for an option to prevent or allow more than one object per grid by setting a flag automatically after receiving an object.

    You could have a setting to not allow two objects, and also a condition for manual, case-by-case situations: Cell is empty, (or Cell = x) IF more than one object mode was on, you could get the count of objects on that grid cell. Also, offsets could allow you to snap several small objects in one grid cell.

    The object would hopefully be able to represent the grid visually with various styles and colors. It would also allow for an offset number so you can choose in which part of a cell or grid the object's coordinates snap to. The visual aspect could be turned on and off as required. Perhaps the grid could be saved, so that the objects could be returned to their snapped positions?

    My example uses a few objects: Background Gradient Object, EZGrid, and Alpha Channel, (used so that I could load bullets and base things on the sizes).

    I see a lot of potential here if the object turns out simple and fast to use. You could use it on either side of the equation: developer or user.

    The author could make their frame, drag objects on the grid, save the file, and have a ready-to-go placement of objects that is reusable and easily edited/modified.

    The user would be able to design layouts or presentations if the application were an editor or creation tool.

    Any other ideas for this object?

    EDIT: It should also be flexible enough to allow moving any object on the grid to another position with an action during runtime.
    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: GridSnap Object Idea

    I didn't look at your example yet (missing some extension), but you can easily achieve snapping with this super simple formula:

    new position = (old position / grid size) * grid size + offset

    Example:

    + Always
    > Object: set X = (X / 16) * 16 + 8
    > Object: set Y = (Y / 16) * 16 + 8

    Of course you can leave the offset away. Make sure not to use floating point values here, as that will "break" the formula (this is using MMF's implicit calculations in integer when no floating point is in the formula).

    Visualizing the grid is nice of course, although you might be fine for most cases with a tiling background (unless your grid's size is dynamic).

Similar Threads

  1. [Idea] Object Database
    By Dines in forum Extension Development
    Replies: 3
    Last Post: 6th June 2009, 01:14 PM
  2. PMO Object... An idea/suggestion...
    By Adam in forum Extension Development
    Replies: 13
    Last Post: 7th May 2008, 12:16 AM
  3. Idea - Mozilla Object
    By LIJI in forum Extension Developers Lobby
    Replies: 9
    Last Post: 10th October 2007, 06:48 PM
  4. JSON object idea
    By ChrisB in forum Extension Developers Lobby
    Replies: 5
    Last Post: 24th September 2007, 11:16 PM
  5. Idea : 360° Object
    By Nico in forum Extension Development
    Replies: 2
    Last Post: 27th September 2006, 11:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •