User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: ISO grid question.

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    America
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ISO grid question.

    If I wanted to have an active object snap to an ISO-grid without using the isogrid object, what coding would I use? I'm sorta lost.

    Yhanks,
    --Jayklik

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    I would go for an 3 dimensional array, and let some math take care of positioning.

    Another great solution, in case the object actually don't move in height, is to program everything in plain 2D, and hide that outside the window area, and then show an isometric representation of that.

  3. #3
    No Products Registered

    Join Date
    Jun 2006
    Location
    here
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    Some formulas for you:

    Definitions:
    TopPointX / TopPointY = the x / y coordinate of the topmost point of your grid (the 0,0 tile)
    isoWidth / isoHeight = the width / height of your isometric grid pieces

    To convert isometric coords to screen coords:

    isoX / isoY = the x / y coord of the tile to find

    screenX = TopPointX + (isoX - isoY) * isoWidth / 2
    screenY = TopPointY + (isoX + isoY) * isoHeight / 2

    To convert screen coords to isometric coords:

    screenX / screenY = the x / y coord of the point on the screen

    isoX = Floor( (screenX - TopPointX + 0.0) / isoWidth + (screenY - TopPointY + 0.0) / isoHeight )
    isoY = Floor( (screenY - TopPointY + 0.0) / isoHeight - (screenX - TopPointX + 0.0) / isoWidth )

    Note I haven't tested these but they should be correct :P

    Edit:

    to make the object snap to the grid, convert it's position to isoX/isoY coordinates (stored in counters / alterable values) then convert it back again. The Floor part of the second formulas will make it snap to the grid

  4. #4
    No Products Registered

    Join Date
    Jul 2006
    Location
    America
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    I'm sorry. I don't fully understand what is being said. Mainly, I don't understand the toppoint variables. Would they be 0,0 on the playfield? I appologise, but if you have some spare time, could I have an example? \

    Thanks,
    --Jayklik

  5. #5
    No Products Registered

    Join Date
    Jun 2006
    Location
    here
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.


  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Posts
    395
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    In isogrid 2 u use the SnaptoY, SnaptoX and SnaptoLvl commands to do prettymuch the same thing. Follow tigerwork's example (the editor because the movement one is bugged atm) that's how i learnt to use it.

    Both methods are prettymuch the same. except one uses an extension and the other math.

  7. #7
    No Products Registered

    Join Date
    Jul 2006
    Location
    America
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    Thanks, Guys. I appreciate all of the help! And brovil, Thanks for the example! Thanks everyone.

    --Jayklik

  8. #8
    No Products Registered

    Join Date
    Jul 2006
    Location
    America
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    Oh... Umm, I'm having another problem. My cursor only moves on the Y axis, no matter where I move my mouse. Is there a problem with my events: Screenshot? Thanks for the help.

  9. #9
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Posts
    395
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    its because u've used an Always and the Y axis is loaded last - it looks like it cancels out the X axis code because u've overwritten the Alterable Values before it gets to use them. You're better off using Iso Grid, its soo much simpler.

  10. #10
    No Products Registered

    Join Date
    Jun 2006
    Location
    here
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: ISO grid question.

    ok, where you've got +0 that should be +0.0 It's only added to force MMF to use decimal values (it auto-rounds otherwise) It probably isn't needed at all, but I'm not sure (I seem to remember that there's a problem with negative coordinates without it)

    The problem you're talking about is because of the second action (Set Alterable Value B) which has "... + (XMouse..." instead of "... - (XMouse..." (half way along) Just change the + to - and it'll be fixed.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Hexagonal Grid?
    By Jacob in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd January 2009, 05:05 AM
  2. Grid movement?
    By Chezzy in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 28th February 2008, 05:03 AM
  3. Does anyone have Grid Object?
    By uprize in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 2nd April 2007, 06:49 AM
  4. Data Grid Object Question
    By drnebula in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 21st January 2007, 03:25 PM
  5. Grid Movement
    By Joni in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th January 2007, 09:51 AM

Posting Permissions

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