Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by crzyone9584 · Dec 12, 2014 at 06:34 PM · 2d-gamexna

Moving from XNA

I've been looking up all the differences between XNA and Unity3d. I've figured out the easy ones like input, vector2, etc. My issue is I'm not finding something similar to Spritbatch. So like in xna you would call spritebatch.draw() to draw your 2d object. Could someone point me in the right direction?

I have a 2d framework in xna for a 2D game that I would like to bring over to Unity to continue my game. I'm not looking to spend money on frameworks already made for 2D games. I have my own and would to figure out the drawing part. As for most of it is just C# code except for the drawing and some other pieces of the code.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by VesuvianPrime · Dec 12, 2014 at 06:41 PM

I first came to Unity from the Python PyGame module, OpenGL Glut, and C++ Allegro. These are all libraries in which you are responsible for drawing things directly to buffers as and when you need them.

Unity is completely opposite to this. In Unity you create your visual assets and instantiate them. You attach your behaviour functionalities as children (components) to these instances.

My first year or so with Unity was pretty tough as I was trying to force Unity to behave like these other engines, when Unity has it's very own paradigms.

I'd reccomend getting familiar with the relationship of GameObject and Component.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image crzyone9584 · Dec 13, 2014 at 05:45 AM 0
Share

Thanks for the answer. I'll look into the GameObject and Component of the Unity Engine. Hopefully it won't take to long to figure it all out.

avatar image
0

Answer by fafase · Dec 12, 2014 at 06:48 PM

From Xna lifecycle, Init/LoadContent could be assimilated to Awake/Start (Start is only call when the object is activated), Update is Update, UnloadContent is OnDestroy.

Draw would be LateUpdate as for when it happens but the purpose is not the same. Unity hides the rendering process while XNA still requires the call to send to the GPU. Forget about it here.

Note Unity has many more callbacks, I guess XNA had also but those are the main ones.

Also, XNA used virtual and override while Unity uses reflection to call a callback method from the lifecycle. Hence the absence of override on the front and no base.Method().

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image crzyone9584 · Dec 13, 2014 at 05:44 AM 0
Share

Yea all the Init/LoadContent, Update, and UnloadContent I've figured out. It is the spritebatch and how to draw things to the screen. Thanks for the answer This helped me a little.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Game Resolution and Scaling Unity 2D 0 Answers

Unity3d Port to XNA? 1 Answer

How can I use 2D sprites for characters in a game with 3D collision? 0 Answers

Isometric 2D images mixed with 3D objects ? 0 Answers

my 3d model is seperating to pieces on xna :( .fbx problem 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges