Draw and erase ?

Hi,
so far, I can draw shapes on a background (using the methods in the java 2D tutorial). But what I'd like to know is how I can erase a shape already drawn.
My game is a monopoly : I can draw houses on the correct squares. Okay, but when the player sells a house, it must disappear. How do I perform this ?
BTW : perphaps there is a better wawy to achieve this goal than drawing on the background (buffered) ? Feel free to suggest anything you would think better ;)
Thanks for your help.

You either have to clear the whole component and redraw everything in the appropriate order, except what you don't want to show anymore, or you have to clear the area of the erased item and redraw what was "under" it. Well, I guess you don't really need to "clear" it, just draw what was under it on top of it again (including whatever background if that shows in that area). More often then not, the former is simpler to do, although not necessarily the best performance-wise.

Similar Messages

  • Draw and erase in AS3 help needed

    Hello all
    I have a 200x200 movie clip in a certain position I am trying
    to draw in as3, and then erase it to reveal another clip
    underneath. I am not able to specify the erase brush to be active
    just on top of that clip not on all over the stage.
    Here what I have so far , scratch is the name of my original
    clip I am drawing back
    var bitmap:Bitmap=new Bitmap();
    var bd:BitmapData=new
    BitmapData(scratch.width,scratch.height,true,0x00FFFFFF);
    bd.draw(scratch);
    bitmap.bitmapData=bd;
    addChild(bitmap);
    bitmap.x = 200;
    bitmap.y = 200;
    removeChild(scratch);
    but when I start erasing I have to start from 0,0 to erase my
    bitmap.
    THanks for your help

    Lgeee wrote:
    And how would i go about doing that?By making a proper design.
    This way, I can easily do what the object itself is made to do, without writing alot of code that checks what kind of object was sendt.
    The first way I did this was:
    Psudo Code:
    Object obj = input.readObject();
    String type = obj.getClass().toString();
    if (type.contains("logonObject")) {
    } else if (type.contains("playerObject")) {
    I don't think that's relevant. I don't see where that code uses anything which is specific to the server and to the client. Those class names look like they belong in the server, so that code shouldn't be in a "shared" class. It should be in a "server" class.
    As for the issue of having to tell what kind of object was sent, I'm sure there are better ways than just sending an object and then having the receiver inspect the object to see what kind of object it was.

  • Draw and erase boxes

    I have a project that will present screen-shot images to
    users’ one-at-a-time. When presented a screen-shot, the user
    needs to categorize specific portions of it. There are 7
    categories, which are color coded (e.g., main content –red,
    navigation – blue, etc.). Ideally, I would like the user to
    click on a category label and then be able to drag a box across the
    portion of the image that corresponds to the category. After
    releasing the mouse a colored box should appear over that portion
    of the image. Users will need to categorize multiple segments of
    each screen-shot. They will also need to erase boxes in case they
    make errors. Does anyone have suggestions for how I might
    accomplish this in Authorware or could you point me to examples
    where I might get ideas about how to proceed.
    Thanks very much.

    Keep a list of all the boxes that are drawn, then erase them
    all and redraw
    only the ones you want to keep. You can use a
    multidimensional list or a
    text string where each line contains numbers separated by
    commas that are
    the box coordinates.
    HTH;
    Amy
    "gibbsDuq" <[email protected]> wrote in
    message
    news:eep7la$qu1$[email protected]..
    > Chirs and Steve, thank you for the information. When I
    draw multiple
    > boxes on
    > the screen, can one box be erased without impacting the
    other boxes? How
    > might
    > I go about this? I'd appreciate any suggestions.
    >
    > Thanks
    >
    >

  • Is there a way to get the songs back after you do a sync and erase? I no longer have them stored on my harddrive.

    Thanks to a wonderful geeksquad agent all my songs have been deleted from my ipod. They had to restore my computer so the ones I downloaded are no longer on my harddrive or in itunes. Is there a way to get the songs back after you do a sync and erase?

    If they are on the iPod there are third-party programs that will transfer then to  a computer. See:
    Copy music from Ipod to new computer...: Apple Support Communities
    If they ae not on either the iPOd or the computer they are gone.

  • I reset and erased my iphone 4 and now I can`t reinstall it! After I choose a language, region. and wifi, it says Please, try again later or contact customer care

    I reset and erased my iphone 4 and now I can`t reinstall it! After I choose a language, region. and wifi, it says Please, try again later or contact customer care. I tried to do with iTunes, and iTunes even sees this iphone, but it`s like blank, there is nothing I can do in iTunes. It uploaded last software for this iPhone 4, but when it tries to do the reserve copy of iphone first, it shows a mistake. And ask to disconnect and connect the device again, which, obviously, doesn`t help.

    This usually happens if the phone has been Hacked / Jailbroken / Modified...
    Is this the case...?
    If so...
    Then... Sorry... But...
    The discussion of Jailbroken Devices is against the Terms of Use of this Forum.
    You will need to look elsewhere.
    Unauthorized modification of iOS
    http://support.apple.com/kb/HT3743

  • How do I get 3 ipods on one computer have their own library without having to sync with another one and erasing its content?

    So I have a computer that I use for my iPod and my list is the main library that stays on the computer along with any other music my mom buys from her account. Anytime that I want to add music to any of theres, a window pops up saying that I need to sync to the library and erase the existing one they have. I dont want to do that I just want to be able to add any music they want for it without it saying that. My moms can add any music under her account to hers it still goes on to mine but at least it goes to hers. When my dads is attached it asks that question like I said before. Any one know how to make them all seperate?

    How to use multiple iDevices on one computer

  • HT5621 My family has an Apple ID and I also have one and I got apps on an iPhone with my Apple ID but I'm giving it away and erasing it an I want to put my account on my iPod and keep my apps and progress from family Apple ID can I do this keeping family

    My family has an Apple ID and I also have one and I got apps on an iPhone with my Apple ID but I'm giving it away and erasing it an I want to put my account on my iPod and keep my apps and progress from family Apple ID can I do this keeping family iCloud

    Open itunes, connect iphone,select what you want, sync

  • I setup my iCloud account on my iPhone 5 with the wrong e mail address, and I don't remmber the password, I reset my tel and erase all the information on my iPhone in order to try to set up a new iCloud account but when I restart I have a problem aga

    I setup my iCloud account on my iPhone 5 with the wrong e mail address, and I don't remmber the password, I reset my tel and erase all the information on my iPhone in order to try to set up a new iCloud account but when I restart I have a problem agaIn , they ask me to put again the old iCloud user account and password, what I can do in order to start the phone when I don't have the correct e mail and I don't remmber the passcode.?

    I have the same problem as the emails go to my iCloud account that I cannot access!!! I cannot answer the security questions as someone else must have set up my iCloud account. Nothing seems to work. It would be great if someone has some ideas as what can be done to recover the situation?

  • How do I use Automator to duplicate a folder with graphics on my desktop and erase their Resource forks?

    How do I use Automator to duplicate a folder with graphics on my desktop and erase their Resource forks?
    I do not use command line and tried to use ZapResourceForksAMAub_1.2 which I downloadedand instaled the Zap Resource Forks.action. Next I tried to use their sample copy-zap-rsrc.workflow in Snow Leopardon my Mac Pro. The 3 different steps are displayed in Automator but there is no place to put in which folder (on my deskto) to copy, and remove the resource forks from the graphic files.
    Can sombody please step me through this please please.
                                                                                          W.W.

    Unfortunately, Back to My Mac only works across computers using the same iCloud account.

  • Why do I have 200 GB of "backup" on my main hard drive?  Any how can I find and erase them?

    I have a MBP that was recently subjected to some liquid damage and taken in for repair.  While it was being repaired, I purchased a second MBP.  My newest MBP is now my personal laptop, and I'm converting the old one over to a work laptop.  In that process, I've upgraded to Lion, and now I'm trying to free up as much hard drive space as possible.  I have already deleted all of the music, photos and videos from the hard drive.  However, when I go to see how much free space I have left, it shows that I have over 200 GB of "backups" on my main hard drive. 
    I have never created any backups on this drive.  I only used an external HD to do Time Machine backups.  How can I locate these backups and delete them in order to free up the hard drive space?

    When you open FINDER, is there a folder titled 'backups?  If not, have to tried 'search' or 'spotlight' to locate 'backups?  By any chance is your disc partitioned?
    You state that you have deleted all music, photos and videos from this drive.  The graphic that you included in your query shows that these are still on the disc.
    The simplest way of achieving your desired result is to open Disk Utility and erase all user data.  However that does not tell us what 'backups' is.  Pure speculation on my part, but if the disc is partitioned, maybe that is how it is represented on the graphic.
    Click on the HDD on your desk top using Command 'I' and see if available space correlates with the the above graphic.  If not this suggest a software issue.
    If it does, you have to locate 'backups'.  As alluded to previously, try SEARCH and SPOTLIGHT.  200GB is hard to hide.  Another technique is to open finder and press COMMAND 'J'.  Click on 'size' and 'calculate all sizes'.  If one of those files is over 200 GB, you have located your culprit.
    Better yet wait for someone who knows exactly what the problem is and will give a simple answer.  I admit I'm grasping at straws here, but maybe I've at least given a bit of a starting point.  Good luck.
    Ciao.

  • How can I store my music and photos on apple tv and erase it from my laptop

    Hi, The reason becouse I bougth the apple T.V. is becouse I will like to have a easy way to storage and view my media files and erased from my main drive on my laptop , but I realised that this documents are attached and if I erased from my laptop it immediatly be erased on my apple t.v. , something is wrong here
    that means that I dont gain any space on my laptop drive, there is a way to storage only on my Apple T.V. ?

    Welcome to the  Discussion Forums.
    Yes there is a way to keep content on the tv while deleting it from your laptop. I don't recommend it and would suggest you consider an external (or even a network) drive to move content from your laptop to, rather than simply deleting it. If you want to know more, read THIS

  • My original Apple ID is associated with an email address that I no longer have access to. How do I reset the system to recognize my new email address as my primary point of contact and erase the other one?

    My original Apple ID is associated with an email address that I no longer have access to. How do I reset the system to recognize my new email address as my primary point of contact and erase the other one?

    If when you go to icloud.com and sign in with your current iCloud ID you see all your iCloud data there, you can safely sign out of the iCloud account on your Mac and choose Delete at all the prompts, then sign back in with the current ID.  This only deletes the data from your Mac, not from iCloud.  Your iCloud data will reappear on your Mac when you sign back in after a brief delay as it redownloads.  If you have automatically imported your photo stream photos to your iPhoto library you won't lose them either (if you haven't, save them to your library first).
    Again, only do this if when you go to icloud.com with your current ID you see your iCloud data there.

  • Lost Ipad today and erased on find my Iphone then later i found it before it was able to erase via wifi how can I reverse the request for erasing to keep all my current content the same

         Today I lost my IPad and was FREAKING OUT !!!!!   When a couple of store attendants told me to use the ICLOUD find my Iphone option in order to erase all the content just in case it fell into wrong hands.    Within an hour via survelance video we located the ipad prior to being able to connect to internet and erase everything.
        Now I am keeping the power off keeping it untouched or unerased,   QUESTION TO COMMUNITY????    Is there a way for me to successfully avoid the erase process  that is due to occurr once I power up and hit the WIFI????   Appreciate any input up front,    BRfromGR

    You cannot prevent it from being erased now. But surely you backup with iCloud or iTunes and/or sync with iTunes so when you get the iPad up and running again, just restore from your iCloud backup, or your iTunes backup and then sync with iTunes again and you will be OK.
    If you don't backup or sync .... Well then you should probably think about doing so in the future. Out of the mouth of a Apple ......
    If you erase then find your iOS device, you can restore the information on the device using iCloud Backup (if backup was turned on before you erased it) or iTunes. For more information, see iCloud storage and backup overview, or your device’s user guide in Safari bookmarks or on the Apple Support website.

  • Help! I reinstalled my Mac and erased my iWeb page in the program.Its published, is there any way to download the pages from Mobile Me?

    Help! I reinstalled my Mac and erased my iWeb page in the program.Its published, is there any way to download the pages from Mobile Me?

    To download your pages from MobileMe simply mount your iDisk.
    Then navigate to the Web > Sites folder where the pages are.
    You can't do anything with them however, since iWeb cannot import them. But it's nice to know that you can download them.
    You need the domain.sites2 files, iWeb uses to store its assets. Perhaps you have a backup?
    See this page for pictures and movies to learn how to use the domain file :
    https://discussions.apple.com/thread/3862332?tstart=0

  • Print out of drawing and QA instructions along with PO

    Hi Gurus,
    I have a requirement of printing the material drawing and the Quality instructions along with the PO print out.
    Material drawing is to be sent to the vendor and Quality inspection instructions to the stores.
    I am updating these documents in the additional data of the material master under document data tab page. Every time PO is printed, these documents should also be printed.
    Is there any standard functionality which meets my requirement ?
    Please answer..Thanks in advance
    regards
    Kumar

    Hi,
    You have to take help of ABAP for this. It is not possible in SAP Standard.

Maybe you are looking for

  • Adding Video to a PDF file

    I have an XP computer and adobe acorobat 8 professional. I have been using the advance editing feature to add movies to my PDF files. I have several questions if anyone can help me out. 1) After a video'd adobe acrobat file has been open and the vide

  • 10.4.4 screwed my drive?

    Ever since this update I can no longer burn cd's/dvd's (errors 0x8002006E, 0x80020022 & 0x8002006D, loads of strange drive noise, crashes itunes, will only read some disks (both cd's & dvd's) doesn't seem to matter what brand or whether they are prop

  • Oracle 9i with Forms6i (having problems with objects)

    I am using Oracle 9i server and dev 6i (forms6i). i have a form based on Object tables (including REF's items). when i try to insert update, delete the reocrd in the form, it gives error. Insert/Update/Delete failed because of OCI_22132: hexadecimal

  • Invoice printout

    hi, How to do invoice printing in batches & background scheduling  ie., suppose there are 20 invoice i want to create spool request & print all 20 invoice-at paerticular date & time. Pl suggest

  • Opening all Appleworks documents in Pages

    I have LOTS of Applework documents in my system, and actually because of a reinstall I don't even have Appleworks on my new iMac right now. I've made the switch to Pages and really like this program (as well as Numbers). Can I have the computer switc