openfocus's Forum Posts

  • Here is a working example with zooming and scrolling:

    http://dl.dropbox.com/u/5426011/examples16/pinchzoom.capx

    I used two layers and only scale layer 1. layer 0 I used to get the touch positions used for zooming. If I scaled the layout instead zooming became very unstable.

    thanks rojo, exactly what i was looking for! =D

    btw, is there anyway to set max zoom, so that you cant zoom outside layout or super close?

  • Hello openfocus.

    This is purely speculative, as I haven't messed with pinch-style controls yet, but I imagine you could save the point touched on the screen to a variable and measure the difference in a 'system tick' event.

    It doesn't look like there's a way to measure two touch events at the same time, though. If only one can be tracked, it might be tricky; with X increasing right and Y increasing down, you might be able to measure just the X/Y position to determine if it's a pinch or spread motion.

    I'll be curious if you get a demo of this working!

    yeah, thats exactly what im trying to do =) but i just cant figure out the variables and the events..

  • ok so ive been looking around the forums but havent found an elegant solution to pinch to zoom without plugins.

    sort of what i want to do:

    create object at touchpoint 1

    create object at touchpoint 2

    measure distance between object 1 and 2

    this distance is "X"

    if distance becomes greater than X (objects moving away) then zoom in

    if distance becomes less X (objects moving closer) then zoom out

    zoom speed could be whatever, just not snapping.

    would this work and could someone help please =)

  • nope, actually i could not; recreated the situation which particles were spawned in a new project without using any plugins and the "blinking particle" bug went away...

    tried to clean away plugins from first project but that did not eliminate the bug

    EDIT:

    false alarm, bug is now back in clean project capx

  • i get the same error

    capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • awesome plugin!

    one "problem" though; i want the bullets to fire at an angle of weapon.angle + random(X,-X)degrees from the weapon but if the weapon changes its angle while firing, so will the bullets mid-flight =(

    anyway to get around that or like add a "spread" variable to the weapon?

    thanks!

    EDIT:

    think i fixed it, changed from "set angle" to "set bullet angle of motion to bullet.angle + random(10, -10) degrees

  • thanks, will check out the tutorials!

  • 1. is it possible to randomly pick the sprite in a particle effect?

    example: i want a "snowing" particle effect that everytime it creates a new sprite randomly picks 1 out of X snowflake sprites.

    2. how do i make the sprites in a particle to start rotating when they are created?

    thanks!

  • awesome, thanks!

  • i have run into a problem; what i want to do is to change to opacity of a sprite depending on how close it is to another sprite but i can figure out a simple way to do it.

    basically, i want a sprite to become more visible as the player gets closer and less visible as the player moves away, in a nice and clean way =)

    thanks!