Shop OBEX P1 Docs P2 Docs Learn Events
problems with mouse(x-y-z) values — Parallax Forums

problems with mouse(x-y-z) values

Franz AchatzFranz Achatz Posts: 140
edited 2007-08-02 10:47 in Propeller 1
Hello,

i have some problems with the xyz-mouse-values.
In the first example only mousez shows the correct value.

gr.textmode(2, 1, 6, %1000)
gr.text(-71,72, Num.Dec(mousex))··
gr.text(-71,56, Num.Dec(mousey))
gr.text(-71,40, Num.Dec(mousez))

In this example mousey is ok.

gr.textmode(2, 1, 6, %1000)
gr.text(-71,72, Num.Dec(mousex))··
gr.text(-71,40, Num.Dec(mousez))
gr.text(-71,56, Num.Dec(mousey))

In this example all values are correct.

gr.textmode(2, 1, 6, %1000)
gr.text(-71,72, Num.Dec(mousex))··
gr.textmode(2, 1, 6, %1000)
gr.text(-71,56, Num.Dec(mousey))
gr.textmode(2, 1, 6, %1000)
gr.text(-71,40, Num.Dec(mousez))

Why do i have to use gr.textmode for the mouse-values all the time???

thank's and best regards
Franz

Comments

  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-08-02 10:04
    Just a guess but in the code for text it says:

    '' address of zero-terminated string (it may be necessary to call .finish
    '' immediately afterwards to prevent subsequent code from clobbering the
    '' string as it is being drawn

    It looks like the subsequent calls to textmode just make sure it gets chance to be written.

    Graham
  • Franz AchatzFranz Achatz Posts: 140
    edited 2007-08-02 10:47
    Hi Graham,

    many thanks, you helped me out by this one.
    When i use gr.finish it works and it saves me 4 longs.

    gr.text(-71,72, Num.Dec(mousex))
    gr.finish
    gr.text(-71,56, Num.Dec(mousey))
    gr.finish
    gr.text(-71,40, Num.Dec(mousez))

    thanks
    Franz
Sign In or Register to comment.