Author Topic: working with LOCATE cursor  (Read 3217 times)

0 Members and 1 Guest are viewing this topic.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
working with LOCATE cursor
« on: February 06, 2021, 11:36:44 pm »
Trying to get the LOCATE cursor working with larger screen

LOCATE 26, 27: PRINT "A"
LOCATE 26, 27, 1, 31, 31
see the cursor blinking under the A but I want to make the screen larger and still see the cursor
*****
This works but what about other screen modes / sizes?
_FULLSCREEN
LOCATE 26, 27: PRINT "A"
LOCATE 26, 27, 1, 31, 3

*****
For example
Quote
SCREEN _NEWIMAGE(1024, 768, 32)
LOCATE 26, 27: PRINT "A"
LOCATE 26, 27, 1, 31, 31

shows the letter but not the cursor

****
Whoops sorry this works

Quote
_FULLSCREEN

LOCATE 26, 27, 0
PRINT "A"
LOCATE 26, 27, 1, 31, 31


DO
    IF INKEY$ <> "" THEN EXIT DO
LOOP




« Last Edit: February 07, 2021, 12:57:26 am by NOVARSEG »

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: working with LOCATE cursor
« Reply #1 on: February 07, 2021, 01:11:35 am »
some code to try

Code: QB64: [Select]
  1. _TITLE "Move cursor with LOCATE.  Press ESC to exit"
  2.  
  3.  
  4. LOCATE 26, 27, 0
  5. PRINT "A"
  6. LOCATE 26, 27, 1, 31, 31
  7.  
  8.  
  9. LOCATE 26, 28, 0
  10. PRINT "A"
  11. LOCATE 26, 28, 1, 31, 31
  12.  
  13.  
  14.     IF INKEY$ <> "" THEN EXIT DO
  15.  
  16.     _DELAY 1
  17.     LOCATE 26, 27, 1, 31, 31
  18.     _DELAY 1
  19.     LOCATE 26, 28, 1, 31, 31
  20.     _DELAY 1
  21.     LOCATE 26, 29, 1, 31, 31
  22.  
  23.  

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: working with LOCATE cursor
« Reply #2 on: February 07, 2021, 02:38:55 am »
I use...

Cursor hide: LOCATE , , 0
Cursor show: LOCATE , , 1

Also I use use LOCATE , , 1, 7, 0 (hide) LOCATE , , 1, 7, 7 (underline) or LOCATE , , 1, 7, 30 (block) or LOCATE , , 1, 7, 2 (rectangle).

There are other end values that affect the cursor height. 8 is double of 7 and 9 is triple of 7, a fairly thick underscore. 10 is the same as 30. 2 is a tall block. Since some of the numbers produce the same results like 30 and 31, I suppose it's just up to the user to pick a preference.

Pete
Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: working with LOCATE cursor
« Reply #3 on: February 07, 2021, 03:50:11 am »
Code: QB64: [Select]
  1. _TITLE "Move cursor with LOCATE.  Press ESC to exit"
  2.  
  3.  
  4. n$ = "1357364"
  5.  
  6. FOR x = 1 TO LEN(n$)
  7.  
  8.     LOCATE 26, 27 + x, 1, 31, 31
  9.     _DELAY 1
  10.  
  11.     PRINT MID$(n$, x, 1)
  12.     LOCATE 26, 28 + x, 1, 31, 31
  13.  
  14.  
  15. FOR x = LEN(n$) TO 1 STEP -1
  16.     LOCATE 26, 27 + x, 1, 31, 31
  17.     _DELAY 1
  18.  
  19.