Page 1 of 1

Position constant value

Posted: Fri Apr 12, 2019 11:33 am
by emeck
Aren't #TOP and #LEFT supposed to be 0, and the other position constants dependent on display's dimensions?
It seems to be hardecoded for me.

For example:

Code: Select all

@DISPLAY 1, {Width = 640, Height = 480, Color = #BLACK}

TextOut(#CENTER, #CENTER, "Text")
TextOut(#LEFT, #CENTER, "Text")
TextOut(#RIGHT, #CENTER, "Text")
TextOut(#CENTER, #TOP, "Text")
TextOut(#CENTER, #BOTTOM, "Text")

DebugPrint("Left: "..#LEFT)
DebugPrint("Right: "..#RIGHT)
DebugPrint("Top: "..#TOP)
DebugPrint("Bottom: "..#BOTTOM)
DebugPrint("Topout: "..#TOPOUT)
DebugPrint("Bottomout: "..#BOTTOMOUT) 

Repeat
    WaitEvent()
Forever 
The text is displayed correctly, but debugprint always prints:
Left: -90000
Right: -80000
Top: -70000
Bottom: -60000
Topout: -30000
Bottomout: -20000

I have tried different display dimensions but always same results. This is with MOS3.11 and HW8.

Edit: same output with HW8 for Linux arm.

Re: Position constant value

Posted: Fri Apr 12, 2019 5:35 pm
by airsoftsoftwair
I think #TOP and #LEFT can also be used for some other purposes like clip regions which makes it impossible to define them as 0...

Re: Position constant value

Posted: Fri Apr 12, 2019 7:05 pm
by emeck
I see it now. I was focusing only on display dimensions but some of those constants work for other things too.
Thanks for the reply.