KermM, could you please release whatever Beta state is now (assuming it compiles)?

I feel that with all that honeymoon, you guys are having with CSE, there will be no time for LuaZM for a loooong time.
nsg wrote:
KermM, could you please release whatever Beta state is now (assuming it compiles)?


seconded.
its the old problem poking its nose up again, this code will freeze your calc.


Code:

printText("a test string with more than 32 chars a test string with more than 32 chars", zmg.makeColor("blue"), zmg.makeColor("black"))
flyingfisch wrote:
its the old problem poking its nose up again, this code will freeze your calc.


Code:

printText("a test string with more than 32 chars a test string with more than 32 chars", zmg.makeColor("blue"), zmg.makeColor("black"))
So you're saying any string longer than 32 characters will freeze the calculator?
no... and i typed that wrong.


Code:

zmg.drawText("a test string with more than 32 chars a test string with more than 32 chars", zmg.makeColor("blue"), zmg.makeColor("black"))


I am saying that trying to display a string with zmg.drawText more than 32 chars will freeze it.
"It" meaning exactly what? String? zmg.drawText? something else?
nsg wrote:
"It" meaning exactly what? String? zmg.drawText? something else?


What "it" are you referring to?
I am referring to the last "it" from a sentence
flyingfisch wrote:
I am saying that trying to display a string with zmg.drawText more than 32 chars will freeze it.
by "it" I meant the calc. Wink
Ok. Here is the conversation as I see it:

KermMartian wrote:
So you're saying any string longer than 32 characters will freeze the calculator?


flyingfisch wrote:
no... and i typed that wrong.
...
I am saying that trying to display a string with zmg.drawText more than 32 chars will freeze it.


flyingfisch wrote:
by "it" I meant the calc. Wink


Do you see why i am confused?

EDIT: i think i figured it out. You insist that it is not the string longer than 32 characters itself that freezes the calculator, but rather the attempt to display it with zmg.drawText does. I think it makes sense to me now.
nsg wrote:

EDIT: i think i figured it out. You insist that it is not the string longer than 32 characters itself that freezes the calculator, but rather the attempt to display it with zmg.drawText does. I think it makes sense to me now.


Exactly. Smile

And when I said:

flyingfisch wrote:
and i typed that wrong.


I was referring to the fact that I accidentally typed printText instead of zmg.drawText. Wink
Flyingfisch, does this change if you try to draw a string closer to the edge of the screen? Does it then freeze with fewer than 32 characters?
this code freezes the calc:

Code:
zmg.drawText(5,5,"a test string with more than 32 chars a test string with more than 32 chars", zmg.makeColor("blue"), zmg.makeColor("black"))


as well as this code.


Code:

zmg.drawText(380,5,"some text", zmg.makeColor("blue"), zmg.makeColor("black"))


My guess is that something goes wrong when text gets drawn off the screen.


BTW, could you merge this topic with this one?



EDIT:

seems that it only has problems displaying off screen in the x direction, y doesn't matter (the code below runs fine):


Code:

zmg.drawText(5,216,"some text", zmg.makeColor("blue"), zmg.makeColor("black"))
In some programs, my screen receiver workaround will actually crash the calculator with a "SYSTEM ERROR" message if the program is run in Screen Receive mode.

I will try to get some stripped down code with just the buggy stuff in it tonight.
Note that SYSTEM ERROR may actually be caused by the OS code. Before OS 1.04 or 1.03 (can't recall), screen receiver and projector modes were very unstable, specially if there was a problem in the USB connection.
Well, I have OS 1.04, so I don't think that's it. And it only happens with some programs.

Also, Kerm, could you allow a transparent background for zmg.drawText()?

EDIT:
Also, some programs, when run twice in a row, give this error: "demo.lua:1:syntax error near <eof>"

I will try to get that stripped down to just the buggy stuff as well. Wink
I'll see if there's a way to permit a transparent background for text, and I'll see why it's crashing when it goes off-screen. I look forward to seeing what you find what that last bug.
Running this twice causes that problem:


Code:

test={}

for i=1, 1000 do
   test[i]="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed porttitor, sapien quis sagittis sodales, metus felis faucibus sem, eget mollis erat dolor non elit. Cras id nibh vel massa auctor euismod. Fusce semper rutrum neque, ut faucibus lacus egestas at. Donec velit augue, pulvinar sit amet vulputate et, consectetur iaculis neque. Quisque eu enim eu est condimentum feugiat. Duis gravida ultrices elit ac malesuada. Sed dui sapien, hendrerit nec mattis in, viverra sit amet nibh. Donec vel sodales risus. Duis facilisis cursus placerat. Donec sed ligula sed odio mollis posuere. Integer ante sapien, cursus eu eleifend in, tristique vehicula arcu. Fusce vel erat nibh, non placerat quam. Vivamus quis nibh ut est rhoncus faucibus et vestibulum elit. Pellentesque vel dui eget leo varius faucibus a ac mi. Nulla a nulla non enim euismod ornare a non mauris. Proin ut sagittis turpis. Maecenas in sem tellus, sit amet placerat ligula. Praesent non augue tellus, a convallis lacus. Curabitur suscipit consectetur aliquet. Nunc vehicula lorem in odio accumsan a placerat neque aliquam. Etiam ultricies orci eu justo dapibus vel elementum libero fermentum. Donec et risus nisi, non pulvinar nunc. Duis quis sem neque. Ut eu dignissim nisl. Maecenas a nisl risus, sed consequat ante. Morbi vitae imperdiet erat. Suspendisse potenti. In urna est, viverra id hendrerit vel, pulvinar eget felis. Donec suscipit, dui ac molestie molestie, mi orci scelerisque mi, quis cursus mi metus eget nibh. Aliquam commodo mi at eros sagittis dictum. Nunc ultrices turpis eu urna luctus dictum. Cras sollicitudin ante quis metus aliquet rutrum. Nam vestibulum velit commodo risus ornare eu varius sem placerat. Maecenas egestas odio eu mi tincidunt in porttitor lorem consequat. Proin libero risus, venenatis ut suscipit et, varius non sapien. Suspendisse eget elementum dolor."

end
can you apply this patch to allow complex numbers? http://luaforge.net/projects/lnum/
I made a simple drawSpritePalette routine, but its pretty slow.

Kerm: could you make a built in function that does this?


Code:

function ffgfx.drawSpritePalette( data, x, y, width, height, palette, res )
   local res=res or 1
   local k=1

   for i=1,height do
      for j=1,width do
         if palette[string.sub(data,k,k)+1]~=0 then
            zmg.drawRectFill(x+(j-1)*res, y+(i-1)*res, res, res, palette[string.sub(data,k,k)+1])
         end
         k=k+1
      end
   end
end


Example usage


Code:

grass = "00000000100100100010010111111111"
grasspalette = {zmg.makeColor(15,255,15),zmg.makeColor("green")}
drawSpritePalette(grass, 1, 1, 8, 4, grasspalette, 4)



data: sprite data.
x, y: positioning
width, height: height and width of sprite
palette: sprite's color palette.
res: resolution. 1 is 1x1 pixels, 2 is 2x2 pixels, etc.
  
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, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 5 of 6
» 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