I do not succes with that problem.
In my Curling game, I have a window for aiming and launching, (drawn by AffLance ) with its Viewport and canvas, with an image and some stones (sprites drawn by AffPL). I can toggle to a Zoom window. But when I come back to Lance window, the image is redrawn, but not the stones ! This is part of my code :
procedure AffLance() 'Aim and Launch window
Close ViewPort canZoom
Open Viewport canLance,xwLance,ywLance to xwfLance,ywfLance
Set Pen Colour Make Colour (200,150,50) : Fill Rect 0,0 to xwfLance-xwLance, 100' end wall
Paste Image 0,50,5 'image of ice and spectators
Sprite 8,xChange, yChange,8 ' Button ChangeVue to toggle
for eql=Hom to Mac 'draws every stone (SHOULD !)
for jrl=8 to 1 step -1
il=10*eql+jrl : CalcP2L(il) : AffPL(il, xPL, yPL)
procedure AffPL(int ip,int xp,int yp) ' Draws stone in Lance, with local coords xPL, yPL.
float p=110/(1050-px[ip]) 'scale
int eql=ip/10 'to get stone color
Sprite 10000+ip, xp, yp, 9+eql : Set Sprite X Scale 10000+ip,p : Set Sprite Y Scale 10000+ip,p ' aff stone redimed
proc CalcP2L : just a small 3D calculation of xy in Lance window
To make clear : On the first launch, this works perfectly. When I toggle to Zoom window (same place, another Viewport and canvas), and from there back to Lance window, I have the image, the button, but no more stones.
The xy are correct for it works on the first time (and I have printed them to be sure)...
Any idea ? Thanks