Discuss Scratch

CurtisThePotato
Scratcher
34 posts

Placing a sprite off-screen

When I give coordinates to a sprite that are off the screen, the sprite will not go off the screen, but instead sit on the edge of the screen. Is there anyway to bypass this? I'm trying to draw a large object as a background to my game and this rule is giving me a problem.
ognimalf
Scratcher
100+ posts

Placing a sprite off-screen

You could try using the hide, wait, and show buttons to make it appear when you want
CurtisThePotato
Scratcher
34 posts

Placing a sprite off-screen

ognimalf wrote:

You could try using the hide, wait, and show buttons to make it appear when you want
This isn't the solution I'm looking for, I'm trying to get a sprite off the screen while using the
stamp
block from the pen extension. I'm trying to make a background that scrolls as a player moves, but as the sprite that stamps the background onto the screen reaches the edge of the screen, it gets stuck and doesn't let the background scroll all the way off screen since I can't get the sprite to go off of the screen.
Scratch-Minion
Scratcher
1000+ posts

Placing a sprite off-screen

1) Make an extra bitmap costume called “Full Size”, and fill the whole costume with any colour.
The important thing is that the costume fills the whole 480x360 area.

2) In the editor select “My Blocks” then “Create a block”, and make a block called “Stamp Costume at”,
click in the little box “Run without screen refresh” (this is not needed if your sprite is hidden!)
and add 2 inputs with names x and y.

3) Add code inside Stamp Costume at x y as follows:

switchcostumetoFull Sizegotox:xy:y The x and y in this line are the inputs - I don't know how to make them the right colour hereswitchcostumetoCostume you want to stampstamp

4) Now you can call your block “Stamp Costume at” with two inputs for the position:
eg. Stamp Costume at 465, 345


Notes:
- the limits you can move to are x = -465, x = 465 y = -365, y = 365
it is the big Full Size costume that lets you move further off the stage.

- your sprite must be hidden or you must have created your block with “Run without screen refresh”.
“Run without screen refresh” prevents drawing until the whole block has run and ensures you do not see the Full Size costume.
Coenw1234
Scratcher
2 posts

Placing a sprite off-screen

I usually just add tiny little dots at the far corners of each sprite…
GIitchInTheMatrix
Scratcher
1000+ posts

Placing a sprite off-screen

Coenw1234 wrote:

I usually just add tiny little dots at the far corners of each sprite…
Please don’t necropost

Last edited by GIitchInTheMatrix (Oct. 25, 2022 17:03:00)

Powered by DjangoBB