Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove function: Sprite::TouchingColor #423

Open
JiepengTan opened this issue Nov 19, 2024 · 2 comments
Open

Remove function: Sprite::TouchingColor #423

JiepengTan opened this issue Nov 19, 2024 · 2 comments
Labels
question Further information is requested

Comments

@JiepengTan
Copy link
Collaborator

  1. This interface is pretty confusing because it makes users enter exact pixel values. From a human point of view, it's hard to tell the difference between RGB(255, 0, 0) and RGB(254, 0, 0). But the code needs these exact numbers to work right.

  2. It'd make more sense to just use something like "touching sprite."

  3. The performance isn't great either, since it has to pull images from the GPU or go through each pixel one by one.

In short, we don't really need this function, so it should probably be removed.

onKey KeySpace, => {
	if touchingColor(RGB(255, 0, 0)) {
		println "touchingColor Red"
	} else {
		println "no touchingColor Red"
	}
}
@JiepengTan JiepengTan added the question Further information is requested label Nov 19, 2024
@JiepengTan
Copy link
Collaborator Author

@xushiwei @nighca

@nighca
Copy link
Collaborator

nighca commented Nov 19, 2024

@JiepengTan It was added for compatibility with the Scratch API Touching Color. Therefore, we need to retain it to make it possible to do auto-transforming from Scratch project to spx project.

While I agree with the points you mentioned above, it isn't an API we recommend to use in standard spx projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants