3 Replies - 4575 Views - Last Post: 08 December 2011 - 11:19 AM

#1 MATTtheSEAHAWK   User is offline

  • D.I.C Addict
  • member icon

Reputation: 137
  • View blog
  • Posts: 782
  • Joined: 11-September 10

XNA Texture Layers?

Posted 05 December 2011 - 08:06 PM

The way textures are layered in XNA kind of confuses me. I want to create a drawing engine in XNA simply for drawing sprites at different layers. Say, I had a button control/sprite in a container that scrolled. Normally, if I scrolled the container, the button would not disappear, it would just go outside of the container. But what I've thought is if I just make a layer for the background of the program at layer 1, then all layers below that would be drawn below it.

Also sorry, this is kind of a half-formed thought. Thanks in advance though. I've given it some thought and studied the MSDN pages and looked around on google for it and couldn't find much for my needs.

EDIT: Tried different query and found this (link). I haven't tried it yet but I will tomorrow after some sleep. (I did the sort mode, just need to mess around with decimals).

This post has been edited by MATTtheSEAHAWK: 05 December 2011 - 08:10 PM


Is This A Good Question/Topic? 0
  • +

Replies To: XNA Texture Layers?

#2 ShadowsEdge19   User is offline

  • D.I.C Addict

Reputation: 142
  • View blog
  • Posts: 664
  • Joined: 16-January 10

Re: XNA Texture Layers?

Posted 06 December 2011 - 04:07 PM

I would suggest you talk with Ntwiles as he's got a similar kind of problem as well in this topic, I've added a link to a simple project of mine that uses a drag and drop control for shapes that utilizes multiple draw orders on all textures used.
Was This Post Helpful? 1
  • +
  • -

#3 MATTtheSEAHAWK   User is offline

  • D.I.C Addict
  • member icon

Reputation: 137
  • View blog
  • Posts: 782
  • Joined: 11-September 10

Re: XNA Texture Layers?

Posted 07 December 2011 - 08:39 AM

Ok thank you very much!
Was This Post Helpful? 0
  • +
  • -

#4 bonyjoe   User is offline

  • D.I.C Addict
  • member icon

Reputation: 178
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: XNA Texture Layers?

Posted 08 December 2011 - 11:19 AM

A couple of the draw method overrides have a layer depth field.

Link

I presume as it is a float you can put any value between 0 and 1 and it will sort them as long as SpriteSortMode is set to FrontToBack or BackToFront.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1