android
  #1  
Old 05-08-2010, 12:50 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default Is it possible to undraw an object?

In order to move an object on screen, rather than clear the screen and redraw everything, is it possible to undraw, i.e. draw the same object but XOR so that it wipes out, then draw it in a different position?

My difficulty in trying to test this is that I can find how to write a pixel but not to read one.

Any assistance appreciated.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 05-08-2010, 01:03 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

There is no function to read a pixel I'm afraid, which is a real pity.
And the most effective way we currently know to undraw an object is to cover it with only the necessary part of the background, which is an easy fix if the bg is a solid piece. If it's made from several images it'll be more of a pain and you might have to redraw it all.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #3  
Old 05-08-2010, 01:40 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thanks habhome. It is a pity indeed, perhaps in a future firmware release this might be made available. I don't want to be a pain but...
Is it feasible to keep a manual copy of the screen buffer, or can I get access to the buffer or get it to copy elsewhere also?

[EDIT] Is it quicker to draw a complex pattern on screen or to load a bitmap?
Reply With Quote

  #4  
Old 05-08-2010, 02:52 PM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

No, I don't think there is any way to access the screen buffer to copy it.

And about your edit, I am not sure. I think that what matters is how many pixels have to change from before, but of course if it is very complex then you will earn a few iterations from loading a bitmap, although you'll have to load it in the beginning or right before you use it, so that'll also take time.
I suggest you try it out and tell us if you feel like it. Myself I use mostly loaded resources instead of drawing complex things on the player.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #5  
Old 05-08-2010, 05:30 PM
Donone Donone is offline
Junior Member
 
Join Date: May 2010
Posts: 59
Default

Thanks again Habhome. I'll do some experiments. It seems that the method you use is similar to an animation movie; you effectively produce each total frame dependent on user interaction.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:17 AM.