nutmix's Forum Posts

  • Even with the origin set to 0,0, objects are not the same in the designer as they are in the browser. I have not seen this problem with R99 or earlier, I believe its a bug in R103. The result is I can get it to look ok in FF, or ok in IE, but not both which is a bit of a show stopper.

    See the following two screen shots:

    1: This is the layout in C2. I move the objects (e.g. "WON: ?100" too low to make them look ok in FF)

    <img src="http://www.ohds.co.uk/c2/wonPosC2.PNG" border="0" />

    2) Now you can see in FF, its moved the text up a bit:

    <img src="http://www.ohds.co.uk/c2/wonPosFF.PNG" border="0" />

    3) But now I check IE, and its the same as C2, So is too low:

    <img src="http://www.ohds.co.uk/c2/wonPosIE.PNG" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want to anchor a button to the bottom center of the screen.

    To set its position, I'm using:

    System Every tick

       set X to windowWidth/2

       Set Y to WindowHeight-100-(spin_btn.Height/2)

    The button has its origin set to the center.

    The result is that the X & Y values vary widly with the screen size. E.g the longer the window, the more it disappears off below the window. The shorter the window, the more the object launches into outer space. Same with the X value. Its only actually correct when the window size happens to be the same a the window size set in the project.

    Here is a 1 sprite capx file:

    https://www.dropbox.com/s/gx2e1gnfn1t1uyy/middleAnchorProblem.capx

    This is making life very hard...

  • Nice trick! Seems to work well. This will save some posts, thanks!

  • Hi, I cant find any man pages for variable scope, does anyone know if there is one?

    1) What are the scope of local vars? E.g. if I create local vars at the top of a group, are they local to a group, the event sheet, or just the next event?

    2) Are global vars global to all event sheets?

    3) To try and simulate objects for better encapsulation and reuse, I want to create vars local to one event sheet. Is this possible, as you only seem to be able to create globals at this level?

    4) I see objects have a "global" setting. This seems odd, as objects seem to be global even if set to "no". E.g. if I copy an object from one layout to another, then modify the copied one, when I create an instance of the object on the first layout, it actually uses the settings from the second layout.

  • I can never find what I'm looking for, and there is no search function for the manual. E.g. I was looking for lerp under expressions page, and didnt know to look under system expressions so had to waste everyone time asking in the forms how to find it. Doing a browser search in the manual page doesnt find anything. Using the "search scirra.com" box only returns forum posts it seems.

    Presumably it cant be hard to make the manual searchable, or downloadable so we can search it ourselves? I would even buy a printed manual if it was updated a bit so I could use an index.

  • Nimtrix, doh! I was looking under expressions:

    http://www.scirra.com/manual/78/expressions

    Which is where the in C2 expression help takes you.

    Its a real shame that you cant search the manual for things like this - I can never find what I'm looking for.

  • Interesting, I didnt now C2 had lerp. Its not in the manual or in the help on expressions so I didnt know it was there - how did the first person find it?

    Mipey - nice example, thanks.

    All this manual maths to move an object from A to B cumon C2, give us a built in MoveTo behavior with easing - you know you want to!

  • I have the same issue - this is my nr.1 desired function.

    I don't think you can do this without someones tween plugin which I am avoiding if I can as they wont be commercially supported.

    I am approximating this with the bullet behavior to send the sprite in the right direction, then stopping it when it goes over a certain coordinate. However, if you make the animation fast, it doesnt seem to stop exactly at the right spot - it seems to overshoot sometimes (which is to be expected). I then pull it back to exactly the right spot.

    I dont know if you can use ease-in with bullet behavior - havent' got that far yet, but I guess you could use the sine behavior at the end?

    Its a shame there is no access to the excellent easing functions in jquery easing plugin.

  • Ok, after many hours of scratching head, Ive figured out the problem. Most of the manuals and tutorials are out of date, and show System loops options which dont exist or have been renamed.

    So I assumed that for each = for each element, as I could not find "for each element".

    So for each element is an event on the array object, not the system object. Doh! half a day wasted.

    Its so easy when you know, and so hard when you dont.

  • I cant get arrays to work. have ready all the man pages, and looked through tutorials. Ive been using arrays for 30 years in probably 20 different languages, including machine code, so am pretty familiar with them.

    Im trying to do this as a sub event of on start of layout:

    System: For each result -> result : Set value at (result.CurX,result.CurY) to floor(random(9)).

    The array "result" is 5x3x1 in size.

    The above code only ever sets the first value, so the for loop is getting stuck at 1 iteration.

    If I dump the json of the resultant array from the above code, I get:

    {"c2array":true,"size":[5,3,1],"data":[[[6],[0],[0],[0],[0],[0]...etc*

    *hand typed as haven't found a way to cut and paste the text from a game yet.

  • Ahhh, ic, I can fix it by using a top left origin. Nice.

    Is there any way to us anchors to anchor an object without stretching it? E.g. not anchor it to left or right, only say bottom? I.e. not anchor it to a corner, but a side?

    E.g. if you want a button to stay at the bottom in the middle, but you dont want it to stretch (which is what happens if you anchor it to left and right). E.g. if you could say NONE in the "left edge", "top edge" "right edge" and only have "Bottom edge" set to window bottom: the system would keep the objects ratio to left and right edges (so if it was bang in the horizontal center, it would keep 50% on the left, and 50% on the right).

    I have to simulate this currently by repositioning the object on every tick.

    Thanks for your help!

  • Just crashed again, this time directly after the computer woke up from sleep. I'm using word, visio, photoshop, eclipse, dreamweaver etc. without issue.

    Im a unix/mac guy, how does one get the dll name from a crash?

    I see these in the event viewer:

    Faulting application name: Construct2.exe, version: 2.0.0.0, time stamp: 0x5051e3db

    Faulting module name: Construct2.exe, version: 2.0.0.0, time stamp: 0x5051e3db

    Exception code: 0xc000041d

    Fault offset: 0x0000000000252c37

    Faulting process id: 0x2564

    Faulting application start time: 0x01cd94d3c38921e3

    Faulting application path: C:\Program Files\Construct 2\Construct2.exe

    Faulting module path: C:\Program Files\Construct 2\Construct2.exe

    Report Id: 740977c7-00cd-11e2-aa7b-f0def169bcca

    Faulting application name: Construct2.exe, version: 2.0.0.0, time stamp: 0x5051e3db

    Faulting module name: Construct2.exe, version: 2.0.0.0, time stamp: 0x5051e3db

    Exception code: 0xc0000005

    Fault offset: 0x0000000000221160

    Faulting process id: 0x8c4

    Faulting application start time: 0x01cd94cc5b39826b

    Faulting application path: C:\Program Files\Construct 2\Construct2.exe

    Faulting module path: C:\Program Files\Construct 2\Construct2.exe

    Report Id: 69b44dae-00c4-11e2-aa7b-f0def169bcca

    Any

  • Ah, I see the problem, the first link has a space at the end. This should not matter, but seems to. Have fixed it.

  • Thats odd, I just right clicked on the file in explorer, then did dropbox->get link. Here it is again:

    https://www.dropbox.com/s/bh6pinkzyr3c6s2/broken_anchor_103.capx

  • Ah, ic! But this is not validated, and it doesn't change when you change the layer name. However, is better than layer number, so ill start using it.