Results 1 to 7 of 7

Thread: sprites in C#

  1. #1
    Senior Member kasavien's Avatar
    Join Date
    Aug 2005
    Location
    St. Albans
    Posts
    1,829
    Thanks
    145
    Thanked
    104 times in 49 posts

    sprites in C#

    Hi all, I'm just beginning to play around with a bit of development again and I need to be able to draw and animate animate objects on screen. My question is what is the best way to manipulate sprites with C#? I've had a quick search around and XNA seems to provide the functionality. Is this what I should use or is there a better way? As an asside, essentially this isn't going to be game development, which is why I'm questioning whether I need to use XNA or not.

    Many Thanks

    Andy

  2. #2
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: sprites in C#

    Xna involves a cut-down version of the core libs, so is not really what you're after

    Perhaps Tao (SDL/OpenGL)?

  3. #3
    Senior Member kasavien's Avatar
    Join Date
    Aug 2005
    Location
    St. Albans
    Posts
    1,829
    Thanks
    145
    Thanked
    104 times in 49 posts

    Re: sprites in C#

    If it's possible i'm intending to develop the software under Visual C# 2008 Express Edition. Would the .Net framework provide the functionality I'm after or would I be better following the SDL/OpenGL route?

    Thanks

    Andy

    Edit: I see that XNA develops under Visual Studio anyway, maybe XNA would be useful for me because I would only need limitted functionality, along the lines of draw sprite and move sprite around.

  4. #4
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: sprites in C#

    I suggested Tao as it's a set of bindings for things like SDL/OpenGL for .NET

    Xna really introduces deployment issues for you though matey, be careful with it

  5. #5
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: sprites in C#

    XNA is an oddity, game developement is still quite traditional, they seldom use any of the modern software design principles, so things like .Net or Java are viewed as just silly.

    MS, for reasons i can't comprehend decided they wanted to help reduce the cost of the software part of game development, even thou this really is a tiny overall cost.

    XNA will run on a desktop, and xbox 360 and even roumers of it running on windows mobile. Everybody knows no one on linux/bsd plays games, their far too busy re-compiling everything because they wanted to use that updated version of libpng.

    XNA has a well support community, and is easy to get to grips with.

    You can also use managed direct-x, and if what your doing is more an application that wants to look 'cool' (which i'm told time and time again i know nothing about) then WPF might well be a suitable technology. You can do incredibly impressive stuff in WPF so very easily!
    throw new ArgumentException (String, String, Exception)

  6. #6
    Comfortably Numb directhex's Avatar
    Join Date
    Jul 2003
    Location
    /dev/urandom
    Posts
    17,074
    Thanks
    228
    Thanked
    1,027 times in 678 posts
    • directhex's system
      • Motherboard:
      • Asus ROG Strix B550-I Gaming
      • CPU:
      • Ryzen 5900x
      • Memory:
      • 64GB G.Skill Trident Z RGB
      • Storage:
      • 2TB Seagate Firecuda 520
      • Graphics card(s):
      • EVGA GeForce RTX 3080 XC3 Ultra
      • PSU:
      • EVGA SuperNOVA 850W G3
      • Case:
      • NZXT H210i
      • Operating System:
      • Ubuntu 20.04, Windows 10
      • Monitor(s):
      • LG 34GN850
      • Internet:
      • FIOS

    Re: sprites in C#

    Quote Originally Posted by TheAnimus View Post
    XNA is an oddity, game developement is still quite traditional, they seldom use any of the modern software design principles, so things like .Net or Java are viewed as just silly.
    Games are traditionally split into roughly three major engines. .NET is a godsend for some parts - fr'example, Second Life uses it heavily, as does The Sims 3, and a couple of Wii games. Other games take other approaches to the non-performance-critical code (e.g. Civilization 4 ships with a complete Python installation for its RAD scriptables)



    MS, for reasons i can't comprehend decided they wanted to help reduce the cost of the software part of game development, even thou this really is a tiny overall cost.
    As I said, different parts of a game's engines require different levels of performance and effort. If time is money, then it's great to be able to get "inferior" developers (e.g. artists) who can build supporting code for what they're doing, using a friendly language like C# or Python rather than C. Doing the WHOLE THING? That's a bit more weird.

    XNA will run on a desktop, and xbox 360 and even roumers of it running on windows mobile. Everybody knows no one on linux/bsd plays games, their far too busy re-compiling everything because they wanted to use that updated version of libpng.
    Now, curiously, a Free Software implementation of Xna was started by those Linux folks - and there's a guy who used that code to make a functional SL2 implementation of Xna: http://silversprite.codeplex.com/

    XNA has a well support community, and is easy to get to grips with.

    You can also use managed direct-x, and if what your doing is more an application that wants to look 'cool' (which i'm told time and time again i know nothing about) then WPF might well be a suitable technology. You can do incredibly impressive stuff in WPF so very easily!
    WPF is more about vectors than sprites, but it might be a solution. And Managed DirectX is also feasible, but I've never looked at it

  7. #7
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,164
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: sprites in C#

    Quote Originally Posted by directhex View Post
    WPF is more about vectors than sprites, but it might be a solution. And Managed DirectX is also feasible, but I've never looked at it
    Not really, you can even program the pixel shaders in WPF.

    I was playing with this when it came out and it was quite fun (but horrifically un-stable), i've no pratical use for this stuff so don't know how its changed:

    http://shazzam-tool.com/

    The sprite support is there, its very easy to use too.

    However, unless you want to make it run in a browser (using Silverlight rather than full WPF) or it is a "traditional like" application which you want to have really cool hardware accelerated bits in, then Managed Direct-X is a better option.
    throw new ArgumentException (String, String, Exception)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •