Author Topic: lines/text  (Read 10557 times)

0 Members and 1 Guest are viewing this topic.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
lines/text
« on: September 17, 2011, 09:17:21 pm »
first of all, what are the x-mins/maxs and y-mins/maxs in axe? the regular line(0,0,10,10) doesn't do anything.
also why is the text on this not working?
Code: [Select]
:.Text
:Fix 0
:Text(0,0,"Press any key...")
:Repeat getKey
:End

does the Text( command use the Ti Basic layout, or a different one?

EDIT: I am using axe parser 0.5.3 and a TI 84+ SE
« Last Edit: September 17, 2011, 09:20:17 pm by parser padwan »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: lines/text
« Reply #1 on: September 17, 2011, 09:22:31 pm »
All the drawing commands operate on a "buffer," which is basically a 768-byte block of memory that holds a picture of what the screen should look like. It doesn't actually get sent to the LCD until you do DispGraph, which saves the tremendous amount of time wasted when the LCD gets drawn after every command. That's one of the reasons Axe is so much faster than TI-BASIC.




Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: lines/text
« Reply #2 on: September 17, 2011, 09:22:49 pm »
dont you have to put DispGraph after Text or Line?
so like
Code: [Select]
:.Text
:Fix 0
:Text(0,0,"Press any key...")
:DispGraph
:Repeat getKey
:End
EDIT:ninja'd XP
« Last Edit: September 17, 2011, 09:23:14 pm by yeongJIN_COOL »
Sig wipe!

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: lines/text
« Reply #3 on: September 17, 2011, 09:25:59 pm »
Sorry, I forgot to add that in the code. however, in the original code I did do Dispgraph right after both text( and line(.
(and they didn't work)
« Last Edit: September 17, 2011, 09:31:17 pm by parser padwan »

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: lines/text
« Reply #4 on: September 17, 2011, 09:36:15 pm »
The text doesn't show up because it's being written directly to the screen, then subsequently overwritten by the DispGraph.

If you want the text to show up on DispGraph, you'll need to use a
Code: [Select]
Fix 5before displaying your text.

If you use that, you should put a
Code: [Select]
Fix 4at the end of your program to restore the text drawing to normal before returning to the OS.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: lines/text
« Reply #5 on: September 17, 2011, 09:49:08 pm »
OK, but when I do fix 5 and then Text(0,0,"Press any key...") it just puts an x-bar at the top right of the screen.
what is the layout for text in axe? is it based on actual x-y coordinates or the Basic layout or something else?   ???

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: lines/text
« Reply #6 on: September 17, 2011, 09:52:42 pm »
In Axe it's X, then Y (reversed from BASIC). Check out the Commands.html file packaged with Axe for anything you're not sure about :)




Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: lines/text
« Reply #7 on: September 17, 2011, 09:57:45 pm »
Axe counts from the top-left corner, the top row being the 0th row (the bottom being the 53rd) and the leftmost column being the 0th column (rightmost is 95th)
If you do Fix 5 before Text() you need a DispGraph after it to write it to the screen.

(btw you can use DiagnosticOff to get rid of the scrolling bar thing)
« Last Edit: September 17, 2011, 09:58:08 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: lines/text
« Reply #8 on: September 17, 2011, 09:59:53 pm »
As an Axe Programmer, you need to think of the screen differently than a BASIC programmer would. You no longer have to deal with Xmin and Xmax and AxesOff and functions like that. By default, the screen is 96 pixels wide and 64 pixels tall. To draw a pixel at one across and five down, use the following function: Pxl-On(1,5) . Using the following command draws a pixel at the top-left most corner - Pxl-On(0,0) . This draws a pixel at the bottom-right most corner : Pxl-On(95,63) . Hope that helps?

To display a message and wait for the user to press a key, try this code:

Code: [Select]
.TEST A simple test program
DiagnosticOff
Fix 5
ClrDraw
Text(0,0,"Press any key...")
DispGraph

Repeat getkey(9)
End
Fix 4

The line, Repeat getkey(9) waits for the user to press Enter.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: lines/text
« Reply #9 on: September 17, 2011, 10:01:18 pm »
In Axe it's X, then Y (reversed from BASIC). Check out the Commands.html file packaged with Axe for anything you're not sure about :)
Yes, but is it just reversed from Basic? ex: in basic, the text command goes 0 at top, 55 at bottom. 0 at left, 94 at right. is it like that?
or does it work like pt-on(, with actual X-Y coordinates? Which brings me back to my first question, what are the window settings in axe; and are you allowed to change them? ???
« Last Edit: September 17, 2011, 10:05:09 pm by parser padwan »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: lines/text
« Reply #10 on: September 17, 2011, 10:03:11 pm »
The "window settings" in Axe are 96 wide by 64 tall and go from (0,0) in the upper left corner to (96,64) in the lower right. You can't change them because those are the physical dimensions of the LCD.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: lines/text
« Reply #11 on: September 17, 2011, 10:04:31 pm »
Just think of the coordinates in Axe like the coordinates for Text( in Basic, only in the opposite order. :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: lines/text
« Reply #12 on: September 17, 2011, 10:05:56 pm »
*and with an extra line of available pixels on the right and bottom sides
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: lines/text
« Reply #13 on: September 17, 2011, 10:11:03 pm »
Sorry for being so stubborn, however now I do understand.  :)
but about my line question...
first of all, what are the x-mins/maxs and y-mins/maxs in axe? the regular line(0,0,10,10) doesn't do anything.

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: lines/text
« Reply #14 on: September 17, 2011, 10:12:36 pm »
Pxl-On and all other buffer commands, including Text, Pt-On, Pt-Change, Pxl-Test, everything like that works via the following coordinate system:



Let me know if that doesn't make sense. Also, Axe is low-level enough (low-level = fast (usually) (it's not a bad thing, just fyi)) that it doesn't come with the ability to change any window settings. Axe Parser, ASM, languages like that are low-level and don't have the same API like BASIC does.

In short, no, you can't change the window settings.

EDIT: Dang it, ninja'd!


What exactly is your line question? Can you share more details?
« Last Edit: September 17, 2011, 10:13:54 pm by buttsfredkin »
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)