-
-
Notifications
You must be signed in to change notification settings - Fork 841
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
Confusion with blt
function
#508
Comments
The existence of #497 is the only thing that tipped me off to the true nature of the issue. |
I understand the situation you're facing well. The reason it seems like nothing is happening is because you are copying a 'black image bank' onto a 'black screen', so the operation is actually being executed. Moreover, this image bank doesn't require loading to produce images. As shown in example 04, you can create pictures using the set command for definitions, or through various other APIs. This situation is similar to sound-related commands. The play command can reproduce sound, but in its initial state, no sound is set for each sound, so 'silence' is played. So, should I write that 'to produce sound with sound commands, you need to set which sound to play'? However, I think nobody would find it strange if the sound in their head doesn't play when they use the play command without setting a sound. Applying the same logic to images, the same principle can be stated. What was the user expecting to be displayed when they used the blt command without setting an image beforehand? Considering this, it feels like stating that a prior load is necessary is an insufficient explanation, and a different approach or explanation is needed. |
This explains why I was getting a black square when using the blt function while testing pyxel on pyxelstudio.net. Perhaps in the "How to use" section a small code snippet could be added that demonstrates, |
I understand the situation! People who come from environments like PICO-8 or TIC-80, where the editor and tools are integrated and only one type of resource can be used, might mistakenly think that the data created with the tool is automatically loaded. The 'How to Use' section is intended to be as brief as possible, providing working code. It's not suitable for checking samples that prepare and load resource files. On the other hand, at the beginning of the 'Resource Editor' section, I've already explained how to read resource data using the load function. The question now is how many people might skip this part and not read any of Pyxel's sample code at all, and to what extent we should cater to these individuals. For now, let me keep the current documentation and continue to observe how it is used. |
Fair enough. In the blt() and bltm() section the user can be reminded of the need to load the resource for the functions to work. I have a follow up on the pyxelstudio.net, it would make sense for the resources to be loaded automatically behind the scenes. This would make it on par with the web versions of PICO-8 or Tic-80 in ease of use for educators to introduce kids to learn python and make simple games. |
pyxelstudio is a project separate from pyxel, you should send your suggestion to them! (email address on the website) |
Hey, thanks for the heads up. I was unaware it was a separate project. |
Context
The
blt
function was the first thing I tried, and it appeared to fail silently.Nowhere in the documentation of
blt
is the need to callload
with a resource file specified.And calling
blt
without callingload
does not result in any warning or error.The text was updated successfully, but these errors were encountered: