It is currently Mon May 22, 2017 4:25 pm



Welcome
Welcome to rfobasic

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today. **You are not required to provide truthful information to any registration questions. Be whomever you wish to be.!


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Locate y,x
Unread postPosted: Tue May 16, 2017 8:41 am 
Offline
User avatar

Joined: Sat Mar 26, 2016 9:23 am
Posts: 92
Only needed for the text console.
Would be very handy for certain programming tasks.

Like Matrix ??


Report this post
Top
 Profile  
 
 Post subject: Re: Locate y,x
Unread postPosted: Tue May 16, 2017 6:27 pm 
Offline
User avatar

Joined: Sat Mar 26, 2016 9:23 am
Posts: 92
I found this in the "Libraries" section.

Roy, pick up the white courtesy phone?
And 'splain how this works???

Code:



Console_Mode_Emulator_Roy

Rem Console Library
Rem With RFO Basic!
Rem September / October 2015
Rem Version 1.00
Rem By Roy Shepherd


!!
This is my 'ConLib.bas' include file.
It is a console mode emulator that works in RFO-BASIC graphic mode.
Works with 'typeface 2' monospace as this font as a fixed-pitch font, the letters
and characters each occupy the same amount of horizontal space

It is important to insert the  'ConLib.bas' include file in the right place, as shown below.

!----------------------------------------------------------------------


!-------------------------------------------------
! Set global variables.
!-------------------------------------------------
! 'globalVar' bundle pointer = 1.
bundle.create globalVar
bundle.put globalVar, "ScaleX", scale_x
bundle.put globalVar, "ScaleY", scale_y
bundle.put globalVar, "Device_W", di_width
bundle.put globalVar, "Device_H", di_height
bundle.put globalVar, "Screen", screen

bundle.put globalVar, "Pos_X", 0
bundle.put globalVar, "Pos_Y", textHeight + (textHeight / 5)
bundle.put globalVar, "TextHeight", textHeight
bundle.put globalVar, "TextWidth", textWidth
bundle.put globalVar, "MaxChrX", maxChr_X

!-------------------------------------------------
! Move to text_x, text_y.
!-------------------------------------------------
fn.def Con_Locate(text_x, text_y)
   bundle.get 1, "TextHeight", textHeight
   bundle.get 1, "TextWidth", textWidth
   textHeight += textHeight / 5
   text_x -= 1
   text_x *= textWidth
   text_y *= textHeight
   
   bundle.put 1, "Pos_X", text_x
   bundle.put 1, "Pos_Y", text_y
   
   gr.move null, text_x, text_y
fn.end
!-------------------------------------------------
! Print text at x, y
!-------------------------------------------------
fn.def Con_PrintAt(x, y, t$)
   Con_Locate(x, y)
   Con_Print(t$)
fn.end
!-------------------------------------------------





Report this post
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred