I think Robot's method is sound. However, it wouldn't actually create a sprite with text on it, but paste a picture of the sprite on the screen with the text. And if the position of the sprite was updated, it could still detect the collision even though it was hidden. I wonder if this would be a performance increase since the sprites are hidden - yet the behavior is still sprite-like?
Here's an example:
sync on
sync rate 60
ink rgb(255,0,0),0
box 0,0,100,100
get image 1,0,0,101,101
sprite 1,100,100,1
hide sprite 1
get image 2,0,0,50,50
sprite 2,400,225,2
a$="This is an"
b$="Illusion of a"
c$="Sprite with"
d$="Text on it"
ink rgb(255,255,255),0
do
cls
x=x+1
y=200
inc change
inc between
if change=1 and between=20 then msg$=a$
if change=2 and between=20 then msg$=b$
if change=3 and between=20 then msg$=c$
if change=4 and between=20 then msg$=d$
if change > 4 then change=0
if between>20 then between=0
if x >= 500 then x=0
sprite 1,x,y,1
paste sprite 1,x,y
text x+1,y+40,msg$
if sprite collision(1,2)=1 then text 0,0,"The Sprites are colliding!!"
sync
loop
It seems you could also change sprite priority this way by hiding all of the sprites and then pasting them in order of greatest priority (which ones are on top).
sync on
sync rate 60
ink rgb(255,0,0),0
box 0,0,100,100
get image 1,0,0,101,101
sprite 1,100,100,1
hide sprite 1
ink rgb(0,0,255),0
box 1,1,48,48
get image 2,0,0,50,50
sprite 2,400,225,2
hide sprite 2
a$="This is an"
b$="Illusion of a"
c$="Sprite with"
d$="Text on it"
ink rgb(255,255,255),0
do
cls
x=x+1
y=200
inc change
inc between
if change=1 and between=20 then msg$=a$
if change=2 and between=20 then msg$=b$
if change=3 and between=20 then msg$=c$
if change=4 and between=20 then msg$=d$
if change > 4 then change=0
if between>20 then between=0
if x >= 500 then x=0
rem toggle sprite priority
text 0,20,"Press space to change priority"
if spacekey()>last_spacekey
spacekeytoggle=1-spacekeytoggle
endif
last_spacekey=spacekey()
if spacekeytoggle=1
center text screen width()/2,0,"BIG Square has priority"
paste sprite 2,400,225
endif
sprite 1,x,y,1
paste sprite 1,x,y
text x+1,y+40,msg$
if spacekeytoggle=0
center text screen width()/2,0,"LITTLE Square has priority"
paste sprite 2,400,225
endif
if sprite collision(1,2)=1 then text 0,0,"The Sprites are colliding!!"
sync
loop
Enjoy your day.