📜  处理 java 屏幕换行 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:25.191000             🧑  作者: Mango

代码示例1
void screenWrap(PVector position) {
    if (position.x < 0){ //warp x
        position.x += width;
    } else {
        position.x = position.x % width; 
    }

    if (position.y < 0){ //warp y
        position.y += height;
    } else {
        position.y = position.y % height;
    }
}