26 December 2023, 10:28 | #1 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Problems drawing a Line in a Window
I've some simple lines of BB2 Code to open a window on the Workbench screen and draw a line from its left top edge to ist bottom right edge:
Code:
WbToScreen 0 Window 0, 0, 12, 320, 240, $100f, "Use +/- key to resize.", 1, 2 Use Window 0 Line 0,0,320,240,1 Repeat VWait ev.l = Event Until ev = $200 What could be the problem? |
26 December 2023, 11:30 | #2 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
To draw in a window, use the command Wline instead of Line!
|
26 December 2023, 18:28 | #3 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Thank you, this works
So, one more question regarding (the formatting of) line drawing. Currently I have this call: Code:
WLine X+xoffset1, Y+yoffset1, X+xoffset2, Y+yoffset2, X+xoffset3, Y+yoffset3, X+xoffset4, Y+yoffset4, X+xoffset1, Y+yoffset1, 1 Code:
WLine X+xoffset1, Y+yoffset1, X+xoffset2, Y+yoffset2, X+xoffset3, Y+yoffset3, X+xoffset4, Y+yoffset4, X+xoffset1, Y+yoffset1, 1 |
26 December 2023, 20:56 | #4 |
Registered User
Join Date: Nov 2019
Location: Celle / Germany
Posts: 147
|
Yes, but only with AmiBlitz. The editor of BlitzBasic does not Support that.
With AmiBlitz you can separate lines by using the @@ operator like this: Wline 10,10, @@ 20,20 |
28 December 2023, 18:49 | #5 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Thank you!
And one last question. I have a main loop that is basically like this: Code:
Repeat VWait ev.l = Event Until ev = $200 But I seem to get no keyboard input from the window. I've put this line before the VWait: if InKey$ = "-" and R>20 then R = R - 1 And when I press the '-' key the value of R is not changed. How can I get keyboard input? Must I use the result of Eventbecause I'm in a Intuition window? |
28 December 2023, 19:35 | #6 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 201
|
Ah I got it: it works when I put the InKey$ result in a variable first:
Code:
pressed_key$ = Inkey$ if pressed_key$ = "-" and R>20 then R = R - 1 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Normal horizontal line drawing issue | leonard | Coders. Asm / Hardware | 3 | 29 March 2021 12:08 |
Blitter Line reverse drawing question | sandruzzo | Coders. Asm / Hardware | 9 | 20 February 2021 05:52 |
Blitter line-drawing mode? | E-Penguin | Coders. Blitz Basic | 2 | 13 April 2019 21:37 |
Blitter line drawing: nothing happens | Crank | Coders. General | 21 | 25 April 2018 21:43 |
Drawing a line... | Lonewolf10 | Coders. Tutorials | 24 | 06 September 2011 00:46 |
|
|