spacedoubt's Forum Posts

  • This post should be under

    Anyhow, take your pick:

  • I think what I told you should work. unless I'm not understanding you. (I think you mean drop, not large)

    If you're not dragging it, don't use drag & drop.

    I'll try to be more clear. and maybe I'm just misunderstanding.

    Give the piece an instance boolean variable. call it "hold", set it false.

    1.

    On piece clicked, toggle "hold"

    2.

    If "hold" = true, set piece position to mouse.x, mouse.y.

    3.

    (no code necessary) next click will set "hold" to false and it will no longer stay with the mouse cursor.

    I'm not sure why you want to destroy and recreate the piece if you're just moving it?

    Hope that helps!

  • Set Cursor is aware of picked objects, object creation is not. If Construct made assumptions about what kind of object you want to create from a family, it could lead to confusion, thus it simply creates a random object.

    I see. Thank you for the explanation!

    Honestly, I feel it would make more sense if you couldn't create an instance of a family object.

    In that case, I'd have to agree with you.

  • Just seems strange that it can pick the right one for the cursor..

    All I want to know is "What's the difference?"

  • I have a confusion. I'll explain (see image below).

    allsprites.spritegroup is a variable for the allsprites family and each one is set specifically (for example, I have "Scenery" sprites, "Death" sprites, "Platform" sprites, etc..)

    allsprites.keynum is a variable for the same family, also set specifically (so I can have Scenery 1, Scenery 2, Death 1, Death 2, etc..)

    LastSprite and LastChosen are variables that update when you push a hotkey or roll the mouse wheel.

    My confusion is that, the set cursor action you see here works perfectly. If I push the scenery hotkey, I get scenery if I push the number, it changes accordingly and so on for all the others.

    But if take out the cursor change and try to create the appropriate sprite (the disabled action), it just chooses any sprite at random, completely ignoring my variables. (yes, I know I need to destroy the previous one for it to update properly like the cursor, this is not the issue, though. It's simply ignoring my variables or my picking or both.)

    What's the difference?

  • blackhornet Thanks. I realize that.

    Anyhow, I get it now. I guess I was just having a hard time seeing why they were returning the same values. Gets kinda heavy and multidimensional to think about with both mouse values and both tile values.. Sleep might help.. G'night!

  • okay. I moved my tilemap from 0,0 and got different returning values..

    But if anyone can explain this to me, I've got my head all muddled up trying to figure it out, heh..

  • tilemap.PositionToTileX(mouse.x) & " | " & tilemap.positiontotileY(mouse.y)

    ??

    I set them both to x and both to y to show they're the same. you can set one to x and the other to y and then reverse it. still the same..

    I don't get it?

  • Is there a way to change the size of your cursor, particularly when it's set to a sprite?

    I'm working on a level editor, and I read somewhere that setting your cursor to a sprite was better for performance than setting the sprite to follow mouse.x,mouse.y. makes sense.

    But I'm scaling to zoom in and out and when I do, the cursor stays the same size, so when i zoom out it seems huge.

    I suspect this can't be done easily, but if someone knows, please let me know!

  • Add the drag & drop behavior.

    EDIT: oh, but you don't want to drag it.. you could toggle a boolean instance variable (state) which tells it whether or not it's dragging.

    like, on click sprite, toggle boolean variable.

    if variable true set sprite position to mouse.x, mouse.y

  • I've noticed PositionToTileX & PositionToTileY seem to return the same value no matter what. Is this a redundancy? Is there any reason for both expressions? Am I missing something?

    I saw this bug report:

    But it seems to have been kind of overlooked since the OP sorta had the usage confused.

    EDIT: Here's a capx

    [attachment=0:5i4evlx5][/attachment:5i4evlx5]

  • I suspect you're falling for the classic floating point numbers trick.

    https://www.scirra.com/blog/141/common- ... nd-gotchas

    Scroll about halfway down to "Expecting math calculations to be exact"

  • That looks great! I've been wanting to do some crazy parallaxing like that. super cool!

  • Awesome! Glad to see this solved. Great solution!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That makes sense.

    I ended up with something I like. It's kinda some weird mixture of everything.. but it works, and I understand it, heh..

    Thanks again!