thought i was onto something but resizing box height offered unexpected behavior...
SetWindowSize(1024,768, 0)
SetVirtualResolution(1024,768)
t=CreateEditBox()
xsize = 200 : ysize = 30
x = 100 : y = 200
SetEditBoxSize(t, xsize, ysize)
SetEditBoxPosition(t, x, y)
SetEditBoxText(t, "This is text")
SetEditBoxScissor(t, 50, 100, 500, 500)
SetEditBoxBackgroundColor(t, 0x40, 0x40, 0x40, 0xff)
SetEditBoxTextColor(t, 0xf0, 0xf0, 0xf0)
SetEditBoxBorderSize(t, 1)
SetEditBoxBorderColor(t, 0x80, 0x80, 0x80, 0xff)
SetEditBoxTextSize(t, 24)
do
if GetRawKeyState(27) = 1 then Exit
x = x + GetRawKeyState(39) - GetRawKeyState(37)
if x < 51
BoxWidth = xsize - (51-x)
SetEditBoxSize(t,BoxWidth,ysize)
SetEditBoxPosition(t, 51, GetEditBoxY(t))
if x < -148 then x = -148
else
SetEditBoxPosition(t, x, GetEditBoxY(t))
endif
if x > 300
BoxWidth = 500 - x
SetEditBoxSize(t,Boxwidth,ysize)
if x > 499 then x = 499
endif
y = y + GetRawKeyState(40) - GetRawKeyState(38)
if y < 101
BoxHeight = ysize - (101-y)
SetEditBoxPosition(t, GetEditBoxX(t), 101)
SetEditBoxSize(t,BoxWidth,BoxHeight)
else
SetEditBoxPosition(t,GetEditBoxX(t),y)
endif
Print(x)
Print(y)
DrawBox(50, 100, 500, 500, 0x808080, 0x808080, 0x808080, 0x808080, 0)
print("Use cursor keys to move text box")
sync()
loop
try
just left/right first. if we had text justification i think it could work as you might want (do the real Text commands work with editbox?)
then, up/down is another story... is the text size shrinking? odd. i only added upkey; when i saw what happened, i didn't bother with downkey.
otherwise, its ugly (my code, i mean)