Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 353259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:48:48+00:00 2026-05-12T11:48:48+00:00

In C# I saw already the SpriteBatch class (In the XNA plugin for XBOX

  • 0

In C# I saw already the SpriteBatch class (In the XNA plugin for XBOX games). In that class is it posible to paint in layers.
Now I want to do the same in Java because I’m making braid (See my other questions) and I have an ArrayList from all the GameObjects and that list is not made in the correct paintoreder.

For exemple: I have a door but the door is painted on the player.

Martijn

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:48:49+00:00Added an answer on May 12, 2026 at 11:48 am

    How about sorting the items before rendering?
    The background items have to be painted first and the foreground ones last.

    If you have a List and items are Comparable you can use

    Collections.sort(list);
    

    If you need a special order, you can implement your own Comparator.

    All that of course requires the items to hold some info on their z-position.

    And you shouldn’t do this in the paint method. sort items when they’re changed, ie. added.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to theme the page /cart/checkout/complete I already saw the settings in admin/store/settings/checkout/settings,
I saw here that: As you probably already know, relying on client-side validation alone
I saw an example that try to explain inheritance in Java. The class Employee,
I saw this: Detecting if a program is already installed with NSIS . I
I saw a class AttributeSelectedClassifier was once created in the following ways: AttributeSelectedClassifier classifier
I saw in Expression Engine I can use {embed:title} and {site_name} variables, but now
I´m new to the Telerik RadScheduler. I've already saw the example on Telerik site
I saw a similar post on Stack Overflow already, but wasn't quite satisfied. Let's
I already saw this question however, it didn't work for me whatever I tried.
Before you mark this as answered in another post (I already saw those). But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.