Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print + scroll text big to an image (is there a better way?)
#12
That's a great way Bplus! Here is a little scrolling mod I just made using the Mouse Wheel, although I think you have done this before. This also centers the Hello on the screen pretty good. 


Code: (Select All)

'Bplus Font Resize - Scrolling Mod by SierraKen
Screen _NewImage(800, 600, 32): _ScreenMove 250, 60
s$ = "Hello"
ls = Len(s$)
size = 1
Do
    _Limit 40
    While _MouseInput
        If _MouseWheel = -1 Then Cls: size = size + 1
        If _MouseWheel = 1 Then Cls: size = size - 1
    Wend
    If size < 1 Then size = 70
    If size > 70 Then size = 1
    Text ((800 - ls * _FontWidth) / 2) - (size * 20), ((600 - _FontHeight) / 2) - (size * 8), size * _FontHeight, &HFFFF0000, s$
Loop Until InKey$ = Chr$(27)
End

Sub Text (x, y, textHeight, K As _Unsigned Long, txt$)
    Dim fg As _Unsigned Long, bg As _Unsigned Long, cur&, i&
    fg = _DefaultColor: bg = _BackgroundColor: cur& = _Dest
    i& = _NewImage(8 * Len(txt$), 16, 32)
    _Dest i&: Color K, _RGBA32(0, 0, 0, 0): _PrintString (0, 0), txt$
    _PutImage (x, y)-Step(Len(txt$) * textHeight / 2, textHeight), i&, cur&
    Color fg, bg: _FreeImage i&: _Dest cur&
End Sub
Reply


Messages In This Thread
RE: print + scroll text big to an image (is there a better way?) - by SierraKen - 03-25-2025, 11:50 PM



Users browsing this thread: 1 Guest(s)