Adding multiple images for tiled background?

Hi,
I'm having some trouble trying to add multiple images to the my tiled layer class. I can't figure out a way how to add these images to my current code. My goal is to add at least 4 images onto the screen.
Here's my code:
private void buildBackground() throws IOException
        Graphics g = getGraphics();
        Image tileImageOne;
        Image tileImageTwo;
        Image tileImageThree;
        Image tileImageFour;
        TiledLayer tiles;
        try
            tileImageOne = Image.createImage("/tile_1.png"/*, "/tile_2.png",
                    "/tile_3.png", "/tile_4.png"*/);
            tiles = new TiledLayer(11, 14, tileImageOne, 20, 20);
            int[] grid={
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                1,1,1,1,1,1,1,1,1,1,1
            for(int i=0; i<grid.length; i++)
                int column = i%11;
                int row = (i-column)/11;
                tiles.setCell(column, row, grid);
tiles.setPosition(GAME_ORIGIN_X, GAME_ORIGIN_Y);
tiles.paint(g);
catch(IndexOutOfBoundsException e)
e.printStackTrace();
catch(IOException io)
io.printStackTrace();
Edited by: vopo on Sep 22, 2007 4:35 PM

I've read the API.
But the thing that confuses me is the uploading of images. I can't figure out how by uploading different images can the code recognize which one would go into the tile.
-I know in the api it shows different numbers to display each tile used with a specified image. But I can't figure out how to code it.
Here's my attempt
private void buildBackground() throws IOException
        Graphics g = getGraphics();
        Image tileImageOne;
        Image tileImageTwo;
        Image tileImageThree;
        Image tileImageFour;
        TiledLayer tiles;
        TiledLayer tiles2;
        try
            tileImageOne = Image.createImage("/tile_1.png");
            tileImageTwo = Image.createImage("/tile_2.png");
            tiles2 = new TiledLayer(11, 14, tileImageTwo, 20, 20);
            tiles = new TiledLayer(11, 14, tileImageOne, 20, 20);
            int[] grid={
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                0,0,0,0,0,0,0,0,0,0,0,
                1,1,1,1,1,1,1,1,1,1,1
            for(int i=0; i<grid.length; i++)
                int column = i%11;
                int row = (i-column)/11;
                tiles.setCell(column, row, grid);
tiles2.setCell(column, row, grid[i]);
tiles.setPosition(GAME_ORIGIN_X, GAME_ORIGIN_Y);
tiles.paint(g);
tiles.setPosition(GAME_ORIGIN_X, GAME_ORIGIN_Y);
tiles.paint(g);
catch(IndexOutOfBoundsException e)
e.printStackTrace();
catch(IOException io)
io.printStackTrace();

Similar Messages

  • Problem using an image for a background

    Hi,
    My environment is Crystal Report 2008 SP2
    I am adding an image for a table header background in my report. The image is of type png.
    I use insert picture when I add it to the report. Up to there everything works fine.
    My problem happens when I try to draw lines on top of the image.
    All the lines that I draw stay underneath the image. Even though I move the image to the back and move the lines to the top.
    Any idea why?
    Is there something that I should do differently if I want to use an image as background?
    Thanks

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Unable to select multiple images for upload

    I have Windows 7 Pro and FF 9.0
    I have an online store and am always uploading product photos for items I have listed. I recently switched from XP Pro to Windows 7 Pro. I had no issues with XP. However, now that I have Windows 7 Pro I am unable to select multiple images for upload when using FF. I can only select one image at a time.
    The issue is unique to FF. I have tried in several other browsers, and FF is the only one that I am unable to select multiple images from.
    I had FF 8.0.1 and upgraded to 9.0... hoping that would resolve the issue. It did not. I have restarted my computer several times which has also had no effect.

    Hi,
    Welcome to the    Discussions
    I see it is about 6 hours since you posted, so I guess you will get this when you wake. (I'll be sleeping then)
    This would be better asked in the forum for Using Leopard inside the Leopard Category sating which browser and which site it was.
    (it probably made lots of sense to you when you were typing it but it seems a little short in facts or workable info.)
    8:43 PM Wednesday; March 24, 2010
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
    Message was edited by: Ralph Johns (UK)

  • [svn:fx-3.x] 7748: Adding preview images for 3.x themes.

    Revision: 7748
    Author:   [email protected]
    Date:     2009-06-11 07:34:57 -0700 (Thu, 11 Jun 2009)
    Log Message:
    Adding preview images for 3.x themes.
    Added Paths:
        flex/sdk/branches/3.x/frameworks/themes/AeonGraphical/preview.jpg
        flex/sdk/branches/3.x/frameworks/themes/Ice/preview.jpg
        flex/sdk/branches/3.x/frameworks/themes/Institutional/preview.jpg
        flex/sdk/branches/3.x/frameworks/themes/Smoke/preview.jpg
        flex/sdk/branches/3.x/frameworks/themes/Wooden/preview.jpg

  • How to use the same (selection) paths in multiple images for batch processing?

    I have a whole bunch of photos I need to batch process, but, when creating an action for this, I stumbled upon the problem that the paths I selected with the pen tool, and saved under the "Paths" tab need to be in every image for to be used in the action. I did try to solve it for some time, but couldn't figure out. Any ideas?
    Many Thanks
    Carlos

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • Adding multiple image stamps to a layer

    Hi Guys,
    I am new to Photoshop scripting and would like to make a short video from the layers in my document. I have made a test video manually with 8 frames and it looks good. Thing is I need to do ~200 now and 8 took me all day (hence the scripting).
    I have been looking at the Applescript method for scripting the creation of the layers. A bit about what I want to do:
    - I have a set of 9 image stamps I want to arange in each layer (3x3) with a little white space between each.
    - Each stamp is an image of a star and I want to cycle through ~200 images for each star to show how their shapes change over time with atmospheric turbulance.
    I have 200X9 images and placig them all by hand would be extremely teadeous :-)
    Can anyone suggest the best way to go about this? I am open to using Java Script also but can't use VBScript on my macbook.
    Thanks in advance for your replies.
    Cheers
    James

    James
    A different approach to Collages in Photoshop may be found here.  There are may ways to something in Photoshop.  Some are better then others and others can do thing not possible in an other.  When in come to Collages there are so many thing one can do.  I have seen some packages for Photoshop the are very fast  and others that do thing their way or randomly.   My package may not be the fastest but I believe my template rules are very easy and strait forward and you should be able to create just about any collage template you need just use your imagination.
    Photo Collage Toolkit
    There are eight scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    Documentation and Examples
    Download

  • Adding changing/adding an image for an analytic

    Post Author: patrick Albaret
    CA Forum: Performance Management and Dashboards
    Hi,I'm trying to add a new image for an analytic in dashboard builder.When I edit an analytic, I go to the layout tab.In this tab, you can associate an icon to an analytic .Click on Change image. a popup occursI want to add a new image in this list.I'm not able to find where I should put my icon.Any tips, clue will be welcome.Patrick

    Post Author: jezbraker
    CA Forum: Performance Management and Dashboards
    Been a while since I've done this - but I think youll find the images in...Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\lib\images\analytics-imagesJust drop in your image and restart your browser i think (dont think tomcat needs a bounce). cheers,jez.

  • [REQ] resizing multiple images for same height or width

    I often insert a lot of images in my indesign documents on a single page. I need to make them of the same height and then resize the image accordingly. I'm using cs6
    For example to align all the images horizontally in a neat way, I change the height manually [for e.g. 60mm] in its dimensions box. Is there a way to do it quickly? Eg. I select all the images and put their height 60mm and their height becomes as specified and they get resized accordingly?
    Same is the requirement of images for width.

    See my reply here: [REQ] fast performance of an exported pdf on slow pc

  • Adding a filename label to multiple images for a book

    Hi. I have finally convinced my studio to go Mac and we are presently playing with a trial version of Aperture.
    I am presently trying to create a new book using the Stock book theme, to create a book of thumbnails. I have taken out all the text boxes and made a page - creating the thumbnails the right spacing and size, but now I am trying to add labels to each thumbnail. I have successfully created a label linked to the meta data (file name) but I want this to apply to all the images. I have about 400 images so as you can imagine don't want to click new label for each one. I have tried to copy and paste the caption but all it seems to do is repeat the same file name, so I have 30 pages all labeled 001.jpg.
    Can anyone help? I'm sure in true Apple fashion its quite simple, but I still have not worked it out and am running out of time.
    Any help would be greatly appreciated.
    Thanks
    Hannah

    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    However, you can only send 4 pics at a time to an external editor.
    Regards
    TD

  • Where are image files stored for tiled backgrounds in the templates?

    I am working with a template, but wanted to change the image that is set to tile in the background of one of the text boxes. I wanted to use another image that is set to tile in a different box, but I cannot locate this image. When changing the image on the Image Fill, after I click Choose, I need to point to an image file - anyone know where these images that are in the templates are stored?

    The files are located in the theme package that's located in the iWeb application: iWeb/Contents/Resources/Themes folder. From there you find the theme, open the package and drill down till you find the image files. You will have to use Quickview to locate the one you want.
    What theme are you using?
    OT

  • Potential [BUG] in PS Touch for Android, v. 1.7.5; can't select multiple images for export in different folders

    Can anyone repro this; it's somewhat situational depending on how you organize your projects:
    In the project selection user interface, go to export (5th icon from upper right) > choose a desired destination (like Save to Gallery or Camera Roll). Choose a project.
    If you have projects residing in multiple folders, try and navigate to another folder by using the "back arrow" icon in the upper left. Once you're out of the folder you just left and try to choose another, PS Touch simply does not respond. (It doesn't lock up; it just doesn't register tapping another folder.) I could have sworn I was able to export images in multiple folder at once before.
    Using a Google Nexus 2013 Wi-Fi model with Android Lollipop 5.0.1. I can record a movie if need be illustrating this potential issue.

    Update: I've worked out the difference between the two sets of errors I get.
    The basic error is this:
    ORA-00200: control file could not be created
    ORA-00202: control file: '+DBLIVE1'
    ORA-17502: ksfdcre:4 Failed to create file +DBLIVE1
    ORA-15001: diskgroup "DBLIVE1" does not exist or is not mounted
    ORA-15055: Message 15055 not found; No message file for product=RDBMS, facility=ORA
    ORA-01031: insufficient privileges
    However if my init.ora contains the line:
    control_files=/opt/oracle/server/10.2.0/dbs/cntrlNEONREL1.dbf
    then I instead get the second error:
    CREATE DATABASE "NEONREL1"
    ERROR at line 1:
    ORA-01501: CREATE DATABASE failed
    ORA-00349: failure obtaining block size for '+DBLIVE1'
    ORA-01031: insufficient privileges
    So basically these must be the same error, just in the second case I'm not trying to put the control file on the ASM so it fails at a different point.
    But both errors must be because of the same cause, I suppose.

  • Checking multiple images for import

    Perhaps there is a way to do this quickly, but I can't find it in the 'help' . OK, so I can 'Uncheck All' or 'Check all' for import - or go through ticking the tiny box for each image I want to import.
    But, is there any way of just selecting a group of images, as you would to 'stack' for instance, and then 'checking' them for import - I can't be the only user who has multiple projects on a single CF card for example and wants to import stuff to different libraries etc (quickly instead of one by one and with a decent sized 'target' area rather than the tiny tick box).
    Given that Aperture majors on 'workflow', perhaps I'm missing something really obvious, in which case, please let me know. If I'm not missing it, why is it missing, please Apple, put some more functions than just 'stack' under the RMB for importing.
    Thanks for any steers.
    Stephen

    OK, sorry, Found it. Select the images then hit the tick box for one and it selects all. Is that in the manual? Perhaps obvious, wish I'd found it before writing the question!

  • Adding multiple images to site and how to avoid copying/pasting identical text on different pages

    Hi guys, I've been using DW up till now and have been recommended to try Muse.
    A couple of questions that I have been unable to answer by searching ...
    1) I want to transfer all images from my old DW site but can't find a way to add these to the new site's assets. Can I only add images manually to a page for them to appear under assets?
    2) In DW I used iframes to have the same text appear on different parts of a site. This means that when text about a product changes, it updates in every instance rather than me having to copy and paste into the different instances. Is an iframe the best process in Muse or is there a better way?
    Thanks in advance for advice,
    Jo

    Hi Jo,
    You can't add the images directly to the assets folder directly. You need to add the images to the pages for them to appear under assets.
    For updating text in every instance, the best way to do so in Muse is to place the text on a Master page and apply it to all the desired child pages. So all you would needed to do is to update the text on the master page and it will updated on all the associated child pages.
    Hope this helps!
    Cheers!
    Aish

  • Multiple Images for albums

    Very recently, I can no longer view the other images I've added to individual albums, in the album artwork viewer. The images are in the file info but not viewable with the 'Selected Images' tab (the next image 'arrow' has diappeared)

    Hi, this is bothering me a lot as well, some time ago I had a thread about it:
    https://discussions.apple.com/message/17555584#17555584
    and this one too:
    https://discussions.apple.com/message/17559240#17559240
    please complain to apple about it, use the feedback page
    http://www.apple.com/feedback/itunesapp.html
    and/or use Bug Reporter.

  • Insert image for a background

    Hi,
    Im trying to put a background on my page. I have the Pages 5.1. I can't send the image at the back and lock it. Can someone help me.
    Thanks

    select the image > Menu > Arrange > Section Masters > Move Image to Section Master > uncheck Make Section Master Objects Selectable
    Peter

Maybe you are looking for