View unanswered posts | View active topics It is currently Thu Apr 17, 2014 2:23 pm






Reply to topic  [ 6 posts ] 
Wish list -pixelstate 
Author Message
Expert

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 186
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post 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:

Code:
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.


Thanks,

Coder A

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot
Play chess for free!


Fri Jan 04, 2013 12:02 pm
Profile
Rookie

Joined: Fri Aug 31, 2012 1:56 am
Posts: 8
Post 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.


Mon Jan 07, 2013 5:55 pm
Profile
Expert

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 186
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post 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.

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot
Play chess for free!


Sat Feb 16, 2013 5:03 pm
Profile
Novice

Joined: Sun Oct 21, 2012 10:01 pm
Posts: 76
Post 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!


Sun Feb 17, 2013 7:25 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 591
Post Re: Wish list -pixelstate
This sounds like a great idea - We'll look into implementing it into ROBOTC!

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Feb 18, 2013 10:47 am
Profile
Expert

Joined: Thu Jan 03, 2013 5:10 pm
Posts: 186
Location: The plateau north of the Ohio River Valley, also known as Cave Country.
Post 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?

_________________
I'm not a robot! I'm british! ~ quote from an asparagus
I am not a robot! I am a unicorn! ~ quote from a robot
Play chess for free!


Mon Feb 18, 2013 5:54 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.