Hey everyone, so I'm doing something pretty basic. moving a person around a larger lay out than the size of the viewport. How do i center a spawned object on the viewport? the viewport parameter doesn't seem to let me use it
Develop games in your browser. Powerful, performant & highly capable.
It depend on the image point of the object to be spawned.
Create Object
X: ViewportLeft("layer")-(ViewportWidth("layer")/2)
Y: ViewportTop("layer")+(ViewportHeight("layer")/2)
that's interesting. i tried using that value but it wouldn't work. why does "layer" need to be passed through it? I'm just trying to understand how this would work. most things you invoke is an object that has a numeric value. if i did "layoutwidth" for example i can /2 to get the value. this seems different.
construct.net/en/make-games/manuals/construct-3/system-reference/system-expressions
ViewportBottom(layer) ViewportLeft(layer) ViewportRight(layer) ViewportTop(layer) Return the viewport boundaries in layout co-ordinates of a given layer. Not all layers have the same viewport if they are parallaxed, scaled or rotated separately. ViewportWidth(layer) ViewportHeight(layer) Return the size of the viewport in layout co-ordinates for a given layer.
ViewportBottom(layer)
ViewportLeft(layer)
ViewportRight(layer)
ViewportTop(layer)
Return the viewport boundaries in layout co-ordinates of a given layer. Not all layers have the same viewport if they are parallaxed, scaled or rotated separately.
ViewportWidth(layer)
ViewportHeight(layer)
Return the size of the viewport in layout co-ordinates for a given layer.
layer is the layer name as you can have many..
ah i see now. yes that makes sense regarding the parallax possibilities. thanks for that!