matriax's Forum Posts

  • I have a menu with X icons.

    When with the mouse i click on a icon this one is selected, ok. I use a instance variable called "active" 0/1. And when is active i set the animation to On. when is 0 animation is OFF.

    Then, when i select another of the icons of the family i created i want the first one get deactivated and activate the last one.

  • I have a family called pointers.

    I want that you only can select one pointer at a time, and if you go to select one while one other is actived this one is deactivated.

    Is a stupid thing but after an hour i can't get it working correctly

  • Thanks for the info! . Will be great have some native/system expresion that do that for RGBA.

  • Ah i see, but the problem is that i will have to add every image selected in that canvas to pick the color.

    So, without using the canvas plugin there is no way, other behaviour or plugin to get the rgb values of a sprite? C2 not any native expresion to get the RGB color values at X/Y point?

  • I think this is your answer.

    Gmoney But is using canvas: "(requires rojohound's canvas plugin) "

    I already can do this, the questions is, how do the same for sprites, colors out of the canvas plugin?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using the canvas plugin i can get the RGB values of a pixel.

    But how do the same for an image out of canvas? Is there any behaviour/plugin or expression to do that?

  • For the 2D tool i'm doing you can pick a point in the sprite and drag it to resize it.

    The behaviour on resizing works.... but only when the sprite not have rotation. In that moment all brokes.

    I tried more expresions, some ones works but then i can't resize on negative values(using distance). So i need the resize behaviour like now on scalers but that works also with any sprite rotation but after various can't get it :S .

    Here the .capx

    https://dl.dropboxusercontent.com/u/659 ... blem4.capx

    For drag i'm using the Drag&Drop2 behaviour by Rexrainbox:

    http://c2rexplugins.weebly.com/rex_dragdrop2.html

    oosyrag Can you take a look on this, please?

  • rexrainbow A lot of THANKS! Now works perfect!

  • rexrainbow It's me or the axis are inversed or something? I set the Angle of the sprite to the drag but is not the same. If you drag the scalr righ the drag slide in other angle ¿? .

    https://dl.dropboxusercontent.com/u/659 ... blem3.capx

    When the sprite angle is 20, the drag is 340. And when the Sprite angle is 20, the drag angle is 340 <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">

    Or again i'm doing something wrong...

    EDIT: Well i fixed doing : Set angle > 360-Sprite.setangle to get the inverse and now the resize works perfect.

    So this is the way this have to work, or in the behaviour you added the angle in degrees inverse as construct2? I ask to put this in my program or wait to you for invert the angle degrees equal than construct2.

  • rexrainbow I see, when i pinned the object i expected that the drag not affect to them or the execution was first or something.

    If i put only horizontal axis in drag&drop2 and keep the sprite at angle 0, works correct, no matter how much the mouse goes to y. But if i rotate the sprite get problems because the angle/axis of sprite/scaler are not the same.

    So, in the same way you added a restriction of Drag&Drop to horizontal/vertical, is there some way that you can add some event of "restriction by angle" or axis? So with that i can rotate the sprite and drag&drop in the Sprite.Angle without problems doing all correctly.

    Here is the same capx adding a keys to rotate the sprite left/right to see what happens when you try to resize in some angle using Both Axis or H/V:

    https://dl.dropboxusercontent.com/u/659 ... blem2.capx

    So we can say: every tick -> Drag&Drop2 Lock angle at (Sprites.angle)

    And we will can drag and drop objects at the angle desired. Is possible?

  • rexrainbow Here the very simple .capx <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    https://dl.dropboxusercontent.com/u/659 ... oblem.capx

  • oosyrag THANKS!

    Really? All this for you is simpler? damn i want your brain! XD

    cos(anglediff(SetAngle,angle(Sprite.x0,Sprite.y0,Mouse.X,Mouse.Y)))*distance(mouse.X,mouse.Y,Sprite.x0,Sprite.y0)

    XDDD Maybe if you like math or have some skills, but for us, the mortals, is other thing

    Now is apply all this to my program design for every sprite scaler but i hope get working today.

    Again, thanks for your help and time!

  • oosyrag Thanks!, now works smooth, but is there anyway to get the math to work like the last image i posted?

    In the image while the pointer is in perpendicular to the object axis not move down/up stay in the same position.

    I tried to change the expresion for curiosity in your .capx , but damn al turns into a mess so fast XDD.

  • I don't know if i found a bug or i'm using it in a way is not correct(I guess the last XD)

    Using Drag&Drop2 and PintTo Imagepoint plugins.

    I have an event called:

    Sprite set width to:

    distance(Scaler_right.DragDrop2.X,Scaler_right.DragDrop2.Y,Scaler_left.X,Scaler_left.Y)

    And event that when the sprite is selected(one time event) > Scaler_right Pinto image point 5 .

    So the idea is set the size of the sprite with the distance between the Scaler_left and the scaler_right. If i move the Scaler_right the sprite is updated no problem.

    But if when is dragging the scaler_right, i move the cursor on Y the distance that is set to the sprite is always the distance of Scaler_left and the mouse.x/y.

    Seems not matter if i pin or set position of the scaler to X point, the distance when is dragging the scaler will be with the mouse.

    I put the events before and after but nothing changes. Seems the pointer event runs more times or have always priority front the PIN or Set position and not set the distance correctly.

    I guess someway to solve the problem is to the distance expresion substract the difference of the Y or something like that but i'm very bad with maths XD.

    Here is the actual program:

    https://dl.dropboxusercontent.com/u/659 ... index.html

    Press the button circle to create one and drag the scaler in the middle-right(the one with a green square) to the right(is locked to move only to the right) and will do the resize correctly.

    But if you stop and go up on Y, the sprite also will be resized. And after some test i found that is because get the distance with the mouse and not with the scaler_right with the pint or with the set position.

  • oosyrag Seems this is the way but it's a bit buggy.

    A better image to explain better how/where to move. Or maybe your expresion is correct and i'm doing something wrong.

    i 'm going to play around the last expresion again to see if i can get it.

    So there is no plugin/behavior to lock some object position to an angle?