manual not precise enough for some expressions.

  • The page of the system expressions ( https://www.scirra.com/manual/126/system-expressions ) state currently that CanvasToLayer and LayerToCanvas functions take (layer) as a parameter, in fact they take 3 parameters:

    CanvasToLayerX(layer, x, y)

    CanvasToLayerY(layer, x, y)

    , same parameters for Layer to canvas.

    Not a big issue, but since it is correctly stated in C2 itself, I might as well indicate it inside the manual.

    Also an exemple for the lerp would be appreciable, since I see a lot of people using it in a non intended way (just an exemple saying if x = 0, returns a, if x=1, returns b, if x = 0.5, returns (a+b)/2 ), but it is only a suggestion (the way people are using it is to set x to a constant, and set a to lerp(a, b, x), which results in a movement towards b, slowing when approching b, never reaching b, and that leaded the community into saying sentences like "the sprite is lerping to this position", "lerp is meant to be use to do an ease in movement", which just does not make any sense, and also tends to make people think x should be multiplied by dt to be framerate independant, which won't work since x is not a time of any kind).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I say x=x+1.

    What is x on the next tick if x was 0 to begin?

    Lerp( self.x,target.x,something*dt) changes self.x because you told it to move some fraction(something*dt), or percent toward the target.x

    If you change something*dt to 0 then it will move 0 percent of the interpolation(movement) of self.x, to target.x.

    That is framerate dependent.

    It is not meant to be pixel perfect, or to ever get exactly to target.x.

  • Thanks, I've updated the CanvasToLayer and LayerToCanvas expressions. I don't think there's much to add to lerp in the manual - "Linear interpolation of a to b by x. Calculates a + x * (b - a)." is pretty concise and accurate, and it's up to the user what you do with that.

  • Thanks, will try to see if there are other unconsistency between the manual and C2 itself

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)