Wish list -pixelstate
Page 1 of 1

Author:  Coder A [ Fri Jan 04, 2013 12:02 pm ]
Post subject:  Wish list -pixelstate

This is my wish: ROBOTC already has an 'nxtInvertLine' function so obviously the robot knows the state of each pixel.
Why don't they make a function that requests the information of the state of a pixel? It would be like this:

bool pixelstate(int xpos,int ypos)

and would return true for pixel on, and false for pixel off. That would be super helpful for any advanced interactive game, menu, or interface on the NXT screen.


Coder A

Author:  natebot13 [ Mon Jan 07, 2013 5:55 pm ]
Post subject:  Re: Wish list -pixelstate

I second that idea! It sure would help for some game making programs, however, if you knew what you were doing, you could "duplicate" the display in code in an array. You would have to write your own algorithms for where lines are being placed and all, but still, you could do it. But it sure would be a heck of a lot easier if even the nxtClearPixel() command returned true if it cleared the pixel successfully. And if the pixel was already off and the nxtClearPixel() command was run it would return false. That might be easier to implement.

Author:  Coder A [ Sat Feb 16, 2013 5:03 pm ]
Post subject:  Re: Wish list -pixelstate

Yeah, I could duplicate the code in array, but that would require another array holding the text graphics, along with line formulas and stuff. the screen doesn't have to know that; it just keeps the pixels in their current state. So the NXT must know the values of the pixels already; we just need a way to access that information.

Author:  amcerbu [ Sun Feb 17, 2013 7:25 pm ]
Post subject:  Re: Wish list -pixelstate

If you dig around, you can probably find the location in memory of the screen data. If this is anything like my TI-89, there should be a void pointer buried somewhere deep in the intrinsic files. In fact, I believe you can memcpy from an array to the screen. Good luck!

Author:  tfriez [ Mon Feb 18, 2013 10:47 am ]
Post subject:  Re: Wish list -pixelstate

This sounds like a great idea - We'll look into implementing it into ROBOTC!

Author:  Coder A [ Mon Feb 18, 2013 5:54 pm ]
Post subject:  Re: Wish list -pixelstate

Awesome! Then it'll be easier to do lots of stuff.

And by the way, amcerbu, I looked in the robotcintrinsics.c file and could not find a screen pointer. Is that where you meant to look?

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group