paulscottrobson's Recent Forum Activity

  • Well, there's three ways you can do this (at least).

    Firstly, create them programmatically, rather than placing them on the layout with drag and drop from the C2 editor, call System.CreateObject in a for loop, then you can use loopIndex to store them in a 2D array.

    Secondly, you could give each an instance variable which is their index in the array (you could use the numbers in the text if these are containers with a sprite and text object in them) and use foreach to copy those values to an array

    Thirdly, if you know they are going to be top left to bottom right ordered, you can use for each (ordered) with an expression something like button.X + button.Y * 10000 which will order them for you in that order, as long as your layout is less than 10000 high

  • This is probably a very dumb question, but I've got hundreds of unread posts. Is there a way of marking all posts as read ?

  • Depends on how many changes of text you want. If it is only two or three you could do them as seperate animations, but if you what general text then pin a text object to it.

  • Thanks newt

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    C2 appears to detect that an object is part of a container and limits any events on that object to objects in that container, but it doesn't pick it up if the object the event on is part of a family.

    I was writing a simple control that has a number, a + above it and a - below it. The idea is that the number is adjusted using the +/- buttons. I created a family Adjuster with an instance variable 'adjustAmount', which has two objects in it, AdjustUp and AdjustDown with the adjustAmount set to 1 and -1 respectively.

    The text object with the number is a container containing an adjustUp and an adjustDown instance.

    The original version (Layout 2) uses a single event to detect a touch on a member of the Adjuster family. The action is to add the adjustAmount in the Adjuster subclass to the boxValue in the Value object, and update the display.

    However, the "Value" is not limited to the one in the Container with the Adjuster object but is the whole collection of such objects , so clicking on an Adjuster causes all values to change.

    Layout 1 is identical save that there are two events, touch on AdjustUp and touch on AdjustDown , this works as intended.

    Attach a Capx

    .... how ? Can't see any upload button <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">

    I've uploaded it to http://studio2.org.uk/ContainerBug.capx

    Description of Capx

    Layout 1 and 2 are identical apart from the event detection on the +/- text items. The idea is that the +/- should only adjust their own value.

    Steps to Reproduce Bug

      Compare Layout 1 (works) with Layout 2 (fails)

    Observed Result

    Layout 2, both numbers are changed by any adjuster button (a +/-)

    Expected Result

    The numbers and +/- should operate independently.

    Affected Browsers

    Should not be a browser specific issue, relates to compilation of events.

    Operating System and Service Pack

    Windows 8.1 current

    Construct 2 Version ID

    205.2

paulscottrobson's avatar

paulscottrobson

Member since 11 Mar, 2015

Twitter
paulscottrobson has 6 followers

Connect with paulscottrobson

Trophy Case

  • 9-Year Club
  • x4
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Email Verified

Progress

12/44
How to earn trophies