Can anyone tell me if this is supposed to work this way? I can work around it but it requires some extra effort.
Keep in mind that I'm using my Sprite and Image class for the objects involved. But the results are the same regardless of whether I use them or hard code the numbers for the respective items.
I set up a sprite and match it to an image ( a vertical strip of 11 numerical digits.) I size the sprite and set the texture co-ordinates to cover the upper 1/11 th of the image. This causes it to display the digit '0'. See the following code:
void DarkGDK ( void )
{
Mouse myMouse;
Image myImage;
myImage.SetFile("NumberStrip.png");
myImage.Load(); // get the image
// create a sprite, position it and match to the image
Sprite mySprite (128, 128, myImage);
// set it to small
mySprite.SetSize(20, 40);
// set the corner limits in the image to use
mySprite.Coords(0.0f, 0.0f, 1.0f, 1.0f/11.0f);
// mySprite.MoveTo(128, 128); // ignore for the moment
// you know the rest of the drill
dbSyncOn ( );
dbSyncRate ( 60 );
dbDisableEscapeKey ( );
dbCLS(dbRGB(255, 255, 255));
dbSync();
// yada, yada, yada
As written, the above works. But if I uncomment the
// mySprite.MoveTo(128, 128);
statement the sprite will stay small but will squeeze in the entire image into that space. In another test, if I re-establish the co-ordinates after the move the intended, partial image remains intact.
Thanks,
Lilith, Night Butterfly
I'm not a programmer but I play one in the office