stevil's Recent Forum Activity

  • So it looks like the best way to do things is to use "pick instance" which is effectively what I was looking for. I can see some situations where that might a little tricky still, but I think in most cases I was looking for this should help. Thanks for that!

    For people who search for this you can find more information on it here:-

    scirra.com/manual/124/system-conditions

    It's a system condition. Another system I'm thinking of playing with storing the UIDs in an array and then using this to reference the different objects.

  • I'm sure there is an easy way to do this but I haven't seen it and not been able to find it in my searching unfortunately. I'm looking to reference two of the same object.

    So for example lets say I have created 10 instances of an object, I want to loop through those 10 objects and changes a variable on each of them but reference another instance of the object. So lets say we do something like this (writing in Sudo code)

    On Ball Collision (We'll call this #1)

        For Each Ball (We'll call this #2)

            Ball#2.height = Ball#2.height - Ball#1.height

    You can see I'm trying to reference 2 objects which are both called ball, but not sure how I would be able to do this. Another example of this would be I had several buckets and I wanted to move the contents of the buckets down the line

    For Each Bucket (#1)

        For Each Bucket (#2)

            If Bucket#2.id = Bucket#1.id + 1

                 Bucket#1.contents = Bucket#2.contents

    A way around this would be to store an the instance of the object in a variable. When I try and search for this all I'm able to find is information on instance variables, and while they are helpful they aren't exactly what I'm looking for ;)

    I hope this makes sense, and hopefully someone will be able to help me out with this. Any help I'd be able to get would be greatly appreciated!

  • Thanks heaps for your help, that's exactly what I was looking for. I was trying to set it by right clicking the object under the properties tab and editing the variable that way (which obviously doesn't work!)

    I knew there would have been an easy way to do it, and I knew I would have felt stupid after being told ;) but hey we all have to start somewhere!

    Thanks again.

  • Sorry guys, a bit of a newbie question yet again for you all. I'm just playing around with things and I have created a family for objects I want moving across the screen. As I want each different object type under the family to move at different speeds I want to create an instance variable to set this in.

    Now I have read the instructions here scirra.com/manual/142/families and it says that once you setup a family instance variable it should then be on the object itself. Unfortunately there is non showing up for me.

    I'm sure there must be a way to do this though and I must be missing something pretty obvious. Is there a way to easily set the instance variables for individual objects under a family?

    Thanks in advance for your help!

  • Hey All,

    I was wondering how you would go about cloning an object in construct. A good example would be if I wanted to make a function which made a text shadow. I would add in a family called "TextShadows" and then I would loop through all of the text objects in that family, and "clone" or "copy" that object and change the colour and set the opacity shift it's position and z-index.

    That's just an example though, I know there are text shadow plugins out there and so on. I'm jsut trying to give a practical example of something I would like to know how to do for future refence. Another example could be I have a few images I would like to tile across the page. So I would add all the different tiles to group, loop thrugh each of the tiles and then loop through the amount of tiles needed creating each tile individually and spreading them across the screen.

    I know you can create an object by using system->create but you have to specify exactly what object you want to create. What I really need to do is to be able to pass it in by code / reference.

    I hope this makes sense =) thanks in advance for your help!

  • I'll add in that I'm able to position things at the bottom of the screen when I set them to CanvasToLayer and this works fine. But if I use this to set the height of something it still does not scale correctly.

  • Hi Guys / Gals,

    I'm using "Scale Outer" for a game I'm working on and trying to make it work on a few screen sizes. For the most part I have things working, unfortunately I need an image to stretch the full width / height of the window which I'm having some issues with.

    What I have attempted to do is set the size of the object to be windowWidth, windowHeight. This works great when the screen is larger but as the screen shrinks to smaller sizes you then see letter box bars around the edge.

    I have tested using "Scale Inner" and this gives the desired results, unfortunately I use the "Scale Outer" scaling for other things so ideally I'd like to avoid having to switch over to this.

    Can anyone point me in the right direction on how to do this at all?

    Many thanks in advance <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I'm sorry, again this is something I searched for but was unable to find the correct answer I was looking for. I'm looking for a way to access and object by it's UID.

    For example, I might create a function which sets the width of an object so for that I would pass in the UID of the object and then set the width, so something like Object( UID ). width = 300 or along those lines. Does anyone know if this is something which is possible to do?

    Thanks in advance for any help anyone is able to offer on this matter!

    Steve

  • Thanks Prox, I can't test it out at the moment but it looks exactly like what I've been looking for. I knew there would have been a simple way to do it.

    Appreciate the help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm sure this has been answered somewhere already so I'm sorry for asking again. What I'm looking for is to check if a mobile device has been rotated and the screens orientation has changed to be on the side. I know using a touch object I can check how far it's been turned left and right but that doesn't actually tell me if the screen has flipped.

    Is there any way to get the full window size rather than just the container that the game is in maybe? I thought about checking if windowWidh > windowHeight which would make me think the screen has been rotated but this doesn't work unfortunately.

    I'd imagine there would be some easy way to do this, unfortunately when ever I search for it all I'm finding is results on how to tell how far the device is turned rather than if the screen has actually changed orientation.

    Any help anyone is able to give me would be greatly appreciated, and sorry again for what I assume is a double post.

    Stevil

stevil's avatar

stevil

Member since 22 Apr, 2013

None one is following stevil yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies