Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

ct.js

Create cool 2D games with a free game editor! · By Cosmo Myzrail Gorynych

confused overd ct.camera.borderX & ct.camera.shiftX, it's like these two concepts are crossing each other's path.

A topic by HardWomen created 20 days ago Views: 22 Replies: 1
Viewing posts 1 to 2
(1 edit)

I am confused over ct.camera.borderX & ct.camera.shiftX, it's like these two concepts are crossing each other's path/fighting each other.

Developer

They are not, borders are checked before applying shiftX and shiftY, meaning that borders ignore the latter parameters’ effect. Borders move the camera so a copy does not go out of the viewport, and shiftX/shiftY are for panning.

For example, you can keep a copy inside relatively thick borders so it is always somewhere in the center of a camera, but with shiftX/shiftY you can pan the camera far away from the copy and its borders. A common case can be seen in platformers, where holding “down” button allows you to crouch and look below the character.