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

  • Home
  • SEARCH
  • 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 8194059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:41:36+00:00 2026-06-07T04:41:36+00:00

in the XNA framework for example there is a SpriteBatch Class. The SpriteBatch.Begin() method

  • 0

in the XNA framework for example there is a SpriteBatch Class. The SpriteBatch.Begin() method accepts parameters like this:

spriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend);

How can I create a class that accepts parameters in the same way?

  • 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-06-07T04:41:37+00:00Added an answer on June 7, 2026 at 4:41 am

    create an Enum:

    enum FooBarMode
    {
         FrontToBack,
         BackToFront,
         Whatever
    }
    

    and use that as a parameter:

    void DoSomething(FooBarMode mode)
    {
        switch (mode) // just as an example
        {
            case FooBarMode.FrontToBack:
                Console.WriteLine("FrontToBack");
                break;
            case FooBarMode.BackToFront:
                Console.WriteLine("BackToFront");
                break;
            case FooBarMode.Whatever:
                Console.WriteLine("Whatever");
                break;
            default:
                throw new ArgumentOutOfRangeException("mode");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering how you'd recommend designing a class, given the fact that XNA Framework
C# XNA Xbox, in this case optional parameters are not optional Thanks to help
first time trying XNA Framework in C#.. followed this tutorial: http://www.uxmagic.com/blog/post/2010/08/17/e2809cHello-Worlde2809d-for-XNA-Game-Studio-40.aspx Everything's ok until
I have a a polygon class which stores a list of Microsoft.Xna.Framework.Vector2 as the
When using a class derived from Xna.Framework.DrawableGameComponent , it requires a Game object for
using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace proj { public class game
This piece of code has been taken from a game built with XNA framework.
I am working on a game project using Microsoft XNA framework, although this question
I'm trying to draw grid using the XNA framework, this grid should have a
I have a color of class Microsoft.Xna.Framework.Color . How can I change its hue

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.