Non-Selectable instances with PICTURE

0 favourites
  • 6 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games

    <img src="" border="0" />

    So as you can see its a sim city like building game where you are building buildings on differences instnaces of the same object. the different builing types are different animations of the same object.

    I want to know how to make the instances that are covered by the top and bottom action bars, not selectable

    FOR EXAMPLE right now if i clicked the blue buildng at the bottom it would select the instance behind that layer and move the green selector there instead of leave it where it is. this is NOT what i want

  • In the past I have checked if the mouse is below an allowed area, or in a range, that way it can only choose those on the map. Or I have also given the sprites boolean instance variables like "Selectable" and if that one is false you can't select it.

    You can set individual instance variables to different values in the editor.


    In other words, when a sprite is clicked, check to make sure is above the menu.

    or if the instance variable "IsMenu" is set, allow the click on the menu.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've usually made separate icons object with the same frames, makes reading events a bit easier.

  • With the new Image Deduplication feature on the latest beta, there's no reason to use the same object as you can make a new one and it won't add anything more as you're using the same image the other objects use. (Current stable version doesn't have this so each sprite/frame that has the same sprite just has their own copy of the image they use)

  • That wouldn't solve the problem though, as the one he wants to prevent clicks on, is under the "different" sprite. Still getting a click for being in the same place.

  • The simplest method is to use a instance variable doing a variable comparison to filter out the instances you don't want to introduce into the selected object list.


    +>sprite.varaiable("canBeTouched") = 0

    ++>on touched sprite... do stuff.

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