Answers for "processing java screen wrap"

0

processing java screen wrap

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;
	}
}
Posted by: Guest on September-23-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language