Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Replace Printing Multi-Digit Numbers with Images?

Author
Message
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 10th Dec 2004 14:11 Edited at: 10th Dec 2004 16:17
If i have an image for each number 1-9 (1.gif,2.gif..etc) and lets say I have a variable called number. In the variable number a random number between 1 and 300 will be stored. Now the part I dont know how to do is how would I print a number out on the screen with my images instead of just a normal number print. I could do it with a one digit number probably but with 2 or more digits I have no clue. Anyone know?

This is a little thing I wrote that is like what I want but like I said only single digit numbers. This only gives a random number from 1 - 6. Obviously it wouldnt be very convenient to do it this way from 1 - 300

wmf
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 10th Dec 2004 21:00
wmf
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 10th Dec 2004 21:04
mistake I used number for the paste. here is the correct code
wmf
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 10th Dec 2004 21:36
ok I was on my wife's pc and didn't check your code
try this last post
FakeBlood
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: Alabama, United States
Posted: 11th Dec 2004 11:09
That is still only for single digit random numbers. I need to know how to do it with big numbers. Like if the random number is 256 i need to print the images 2.bmp, 5.bmp, and 6.bmp side by side to display 256. I'm sure its possible since lots of games use images for scores etc instead of just printing the numbers.
wmf
19
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 12th Dec 2004 05:51
sorry, I misunderstood. this code is for rnd 256. change the picwidth to match your bmp's. you should be able to use some of this.

Login to post a reply

Server time is: 2024-09-23 06:28:39
Your offset time is: 2024-09-23 06:28:39