Are you using Text(5,5,"Test"), not Text 5,5,"Test"? There's a difference -- Text( (with parentheses) is like Output(, while Text (without parentheses) is like Disp.
I use Text(
Note that if you have constant coordinates you save a crapton of bytes by doing

Code:

Text(y*256+x)
Text "text"


As long as you are using that or Text(x,y,"text") I don't see what is wrong. You are either inadvertently clearing the screen somewhere else, or the repeat getkey is reading a keypress too fast for it to loop the grayscale properly (try repeat getkey(15) maybe to continue only on hitting clear)
It does work now, I accidentally copied some code wrong. :S
I got a question: How do you display a pic in ram to the screen?
I have this code:

Code:
:.AA
:[Pic1]
:DispGraph
:getKey{r}

Well, it doesn't display pic1......
Try doing this:

Code:
[Pic1]->Pic1
Pic1->DispGraph
Well, that doesn't work, but I found out a other solution:

Code:
[PIC1]->A
Copy(A,L6,768
DispGraph
Still thanks!
souvik1997 wrote:
Try doing this:

Code:
[Pic1]->Pic1
Pic1->DispGraph


Newer Axe versions have changed the syntax for that operation, it is now like this:

Code:
[Pic1]→Pic1
DispGraph(Pic1)
Yeah, syntax changed. PTR→DispGraph is now DispGraph(PTR). And Sorunome, use
Code:
[Pic1]->GDB1
Copy(GDB1,L6,768)
DispGraph
instead. GDB1 is a contant number, unlike A which is a variable.

If you just want to display the image and not do much else with it, use DispGraph(GDB1).
i gots a question... How would you join X+", "+Y into Str1
spud2451 wrote:
i gots a question... How would you join X+", "+Y into Str1


Well, since unless the the >Dec routine has changed into returning a pointer to a string representation of a 16 bit int, you'll need to first have a routine that converts from int to string, I'll try to whip one up on the spot:


Code:
Lbl ITOS
  r2+4->r2
  r1^10->{r2--}
  While r1
    /10->r1^10->{r2--}
  End
  Str2-4
Return


Takes a pointer to a memory chunk to use for the output string, returns the original pointer for ease of use with HL pipelined code. Now to concatenate with that is pretty darned easy:


Code:
"     ,      "->Str1
...
ITOS(X, Str1)
ITOS(Y, Str1+7)


I mean, I haven't worked with Axe for a while so there could be a better way around it that was recently added; but I don't like poking my head into it's API anymore so this is all I can offer.
Thanks ashbad and now i have another question... How do you display the token given by input as text?
spud2451 wrote:
Thanks ashbad and now i have another question... How do you display the token given by input as text?


Well, input first of all yields an allocation with the last input text, so first you would capture it in a variable or something similar. Then you could run through the returned token string and find the length, and use it sequentially print out each token and check if it's one or two bytes, and then advance the index pointer by the needed amount. This routine I'll whip up on the spot (again) should do it, taking for it's parameter the pointer to the token string to print, and has a void return type:


Code:
Lbl DRTOK
  While
    1
    Disp r1>Tok
    {++r1+not(inData({r1},[5C5D5E6061AA62637EBBEF]))->r1}·eFF00
  End
Return


I can't test it, but it should work. Please tell me if you don't understand this or the previous one so I can walk you through how it works.

EDIT: and here'show you could invoke that:


Code:
DRTOK(input)
thanks ashbad
Hey I want to make sprites with grayscale larger than 8x8. How would I start? Also I need help with animation. Thanks

Enigma
To draw sprites larger than 8x8 pixels, you need to either use the Bitmap() command or break up your sprite into multiple 8x8 sprites and draw them with PtOn(), PtOff(), PtChange(), etc. You would draw one layer onto the main buffer and the other layer onto the backbuffer, and use either DispGraph^r or DispGraph^r^r.
Thanks for the tip but I was just wondering about speed.
Enigma wrote:
Thanks for the tip but I was just wondering about speed.


?? Didn't you just ask about how it would work, rather than how fast it would take? (at least, I think that's what I think you mean when you say what you're now)...

... but concerning speed, the Pt-On command is rather fast (read: fastest you're going to get), but the Bitmap one is quirky and slow, so try to use Pt-On whenever possible.
Oh, sorry Ashbad if that's what you thought I meant. I meant out of all those methods which one would be the fastest but I have decided to go with the Pt-On method. I've found a way to do large sprites in hex. Thanks

Enigma

Edit: OK, Now I have another question. How do you do animations in Axe?
Please don't double post. If you have something you want to add, and it hasn't been 24 hours since your last post (if yours is still the most recent post), just edit your last one. The edit button is to the top right of your post when reading the topic.

That said Smile Animation is a large subject that encompasses lots of techniques. The easiest that doesn't involve Line( is to use two or more sprites, and write them at the same place, in order, on the screen, with a DispGraph between each drawing.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 7, 8, 9, 10, 11, 12  Next
» View previous topic :: View next topic  
Page 8 of 12
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement