|
Post by rosy on Oct 28, 2021 16:00:11 GMT -6
Back in the game Rokart ... Gives a link to 2 additional files: drive.google.com/file/d/17mYd_e2zIS77ZmnRVVDoo-HKNZt9aFQm/view?usp=sharingdrive.google.com/file/d/18a8hJD15727b-BmydmcPPw4MHqTjCeIf/view?usp=sharingThe exit from the route is signaled with a sound. In the basic view (variable wid = 0) it is OK. With scrolled views, the sound appears even when we are not leaving the route. Change the views with the W key. Everything happens in SUB GRA2, there is ClearCanvas, DrawImage and GetPixel in the loop. Any additional views appear later, so it shouldn't matter (variable wid>0, SUB WIDOK). SUB WIDOK simply displays the image from a different perspective. It looks to read the pixels of an image that has been deleted by ClearCanvas and additionally overwritten with another image ...
Moreover, when, for example, in line 20, he enters:
SetClearColor(4278229299)
Instead of the game image, I have a green screen ... What does CLS do? Can I set the transparency color of Canvas?
|
|
|
Post by n00b on Oct 29, 2021 16:56:55 GMT -6
GetPixel() reads from the window buffer which is only updated when the Update() function is called so it will have the last image that was rendered on the last call to Update().
Cls() clears the window buffer which is only necessary when using PrintS() and InputS() since they draw directly to the window instead of the current canvas.
Look at CanvasOpen() in the Canvases section in the manual for details on how to set a transparent canvas.
|
|
|
Post by rosy on Oct 30, 2021 3:04:16 GMT -6
Ok, I will check. I don't know how I could have missed it .... What about that green screen instead of the game image ...?
|
|
|
Post by rosy on Oct 31, 2021 7:24:44 GMT -6
In CanvasOpen I don't see the choice of transparency color.
|
|
|
Post by n00b on Nov 1, 2021 6:18:08 GMT -6
You don't need to set the transparency color for your canvas. It is just transparent. If you want to set a transparent color for your image you would use ColorKey() which you can find in the "Loading and Drawing Images" section.
|
|