Does *DISPLAY accept variables?

Discussions related to graphics (2D and 3D), animation and games programming
Post Reply
Lubomyr
Posts: 2
Joined: Mon 27 May 2019, 02:28

Does *DISPLAY accept variables?

Post by Lubomyr » Mon 27 May 2019, 02:48

*DISPLAY "BRW.bmp" 200,1100,100,100

works fine but

SIDE=100
*DISPLAY "BRW.bmp" 200,1100,SIDE,SIDE

does not, and neither does

ANY$="BRW.bmp"
*DISPLAY ANY$ 200,1100,100,100

Is there a better way to display a bmp at a particular location?

Edja
Posts: 11
Joined: Tue 03 Apr 2018, 12:07

Re: Does *DISPLAY accept variables?

Post by Edja » Mon 27 May 2019, 10:04

If you want to use a *command (*DISPLAY) with variable(s) then you should resort to OSCLI
In your case replace

Code: Select all

ANY$="BRW.bmp"
*DISPLAY ANY$ 200,1100,100,100
by

Code: Select all

ANY$="BRW.bmp"
OSCLI "DISPLAY """+ANY$+""" "+"200,1100,100,100"
Maybe I could get rid of a few """ 's, but I just took the example from the help section (search for OSCLI) and filled in your bits and pieces (with a bmp file that I found somewhere on my HD).
It works fine. Hope this helps.

Edja

Lubomyr
Posts: 2
Joined: Mon 27 May 2019, 02:28

Re: Does *DISPLAY accept variables?

Post by Lubomyr » Tue 28 May 2019, 08:05

Yes, your suggestion works. I had seen mention of OSCLI, but didn't grasp that it would work this simply:

bmpfile$ = "mypicture.bmp"
x=111
y=222
w=100
h=100

and that the following line, exactly as shown, does display mypicture.bmp at position x,y and scaled to the width and height specified

OSCLI "DISPLAY """+bmpfile$+""" "+STR$x+","+STR$y+","+STR$w+","+"STR$h

Much obliged!

Post Reply