Quote:
Originally Posted by Boris
Quote:
Originally Posted by chibishmoo
Hey, still working on my game, god im so bored... I would work on my online rpg but it was corrupted in my usb drive. Soooo, how do you print directly to a picture box, without using a label inside it? Thanks
just use picture1.print
if you want to clear it just picture1.cls
set picture1.CurrentX and picture1.CurrentY to position your
"graphic cursor", which is where your text will print.
I would set the Scalemode to pixels so your CurrentX and CurrentY
values directly match your pixel scale.
The graphic cursor is updated by any drawing commands, including
print.
Print will automatically set CurrentX back to 0 and CurrentY will
increment based on the height of the text.
If you wanted to print a column of strings in one area of the window,
you could save some time by setting the ScaleLeft value to a negative
number, which means 0 is now moved to the right, inside your box.
Example: I want to print four scores in a column at the right side of
the window 40 pixels from the right side, and at the top of the window.
Lets say the area for the four scores is 50 pixels high.
I would.
Assuming my backcolor is 0 (black)
Code:
With Picture1
.ScaleLeft = -(.ScaleWidth - 40) 'put's left at a neg. number that puts "0" 40 pixels from the right edge.
Picture1.Line (0, 0)-(40, 50), 0, BF 'clear the Scores area,
.CurrentX = 0 'Set my graphic cursor to (0,0) (relative)
.CurrentY = 0
For i = 1 To 4 'The scores will print in a column 40 pixels from the right
Picture1.Print Score(i)
Next
.ScaleLeft = 0 'reset scale so that "0" is at the left edge again.
End With
So if you are printing to set locations, and you know the size of the
area, you can just clear a block, and write the new text.
Even better, If you are going to write the same number of characters
to the same spot on the screen, you can set FontTransparency to False
and the fonts will have a background color, and will "erase" the old
characters they print over, in which case you wouldn't have to use the
.Line method to clear the area first.