A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: how to create minimap for Flash AS2?

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Posts
    3

    how to create minimap for Flash AS2?

    what im trying to figure out is how exactly do you create a minimap that can register each object location

    below is an example to show what im talking about

  2. #2
    Tutorianus Hominidus
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    4
    hi,

    first, a question: do you use AS3?

    for your problem I see 2 possible solutions:

    1. either you duplicate the big movieclip and resize it to a minimap
    2. or you draw the object twice, once in the big movieclip and once in the minimap - for this you would have to do the coords translations something like

    if bigMC- object in the big movieclip with coords:
    bigMCx,bigMCy
    and width/height of the big movieclip:
    bigW,bigH

    and the corresponding minimap obj
    smallMCx,smallMCy

    minimap sizes
    smallW,smallH

    you have the following translations

    ratio = smallW/bigW = smallH/bigW
    //the minimap obj scale will be
    small._xscale=small._yscale=100*ratio;
    //the resulting minimap obj coords inside the minimap
    smallMCx = bigMCx*ratio;
    smallMCy = bigMCy*ratio;


    hope it helps

  3. #3
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    I'm guessing the objects are going to be moving. I would use onEnterFrame to continually update your minimap.

    For the mini-positioning, I would make scaled-down positions for the objects. Like miniPoint1._x = bigPoint1._x/10; for a 1/10th scale mini map. The mini-map would be in its own movieclip, so the coordinates will be localized to the movieclip.

    Hope that makes sense.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center