How do I create image maps

0 favourites
  • 5 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • Hi

    I'm busy making a point and click adventure game. From what I gather using other browser based games it normally use js image maps in order to deal with scaling and different display resolutions.

    I'm not keen to use layers or "hidden" object because they don't resize and need to be updated when the image change resolution.

    Is there a way to achieve creating these imagine maps \ zones that deals with scaling and also allow for easy definition, i.e. if a user uploads an image he can define these zones. Some restrictions can be put in place to deal with a fixed resolution or image size.

    Thanks for the help!

  • Honestly, I don't see anyway but using hidden/null objects. You will have to just create the algorithm for adjusting the hidden objects position when needed. Getting the new scale of the image and applying that scale to the object position. I did some like this for a tool I built for Renpy helping users generate the hotspot code that they needed. I kept the scale size to apply to the objects that the user laid down as hotspots. The hotspots was then put in a array that held their information. For the resolution you can just keep track of what the original resolution was versus it current to get the scale percentage.

    This is what I made in Construct but I had to event it to do what I wanted.

  • I would check out and read up on the "anchor" behavior. I think it would be pretty easy if you where familiar with the slicing tool in photoshop. You could get the x,y cords from photoshop. Shouldn't be too hard with a little thought.

  • Thanks for the replies. I'm really interested in doing it in a fashion that it can be used at run time. In order for player to add their own image map or hot spot. In some cases it might just need to display a tool tip and in other places it should be clickable and then the user is directed to various layouts.

    Thanks for the advice thus far.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes the way mines is done is during runtime. Mines just serves a different purpose. You can check out how it runs https://www.dropbox.com/s/gs9bgmv6a31iql.zip?dl=0.

    I am still working on it in my spare time but they find it usable enough right now. I have plans to make it they can move the hotspots around if they want to.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)