Click here to Skip to main content
15,896,330 members
Articles / Artificial Intelligence

XNA Snooker Club

Rate me:
Please Sign up or sign in to vote.
4.99/5 (132 votes)
8 Mar 2010CPOL17 min read 316.2K   8.4K   210  
WCF-enabled multi-player XNA game for the Windows platform.
using Microsoft.Xna.Framework.Graphics; // For Texture2D
using Microsoft.Xna.Framework; // For Vector2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Snooker.Client.Core.Model
{
    public class KeyboardSprite : Sprite
    {
        public KeyboardSprite(Texture2D texture, Vector2 position, Vector2 size)
            : base()
        {
            Texture = texture;
            Position = position;
            Size = size;
        }

        public void Draw(SpriteBatch spriteBatch, Vector2 offset)
        {
            Vector2 position = new Vector2(this.position.X, this.position.Y);
            Color color = new Color(255, 255, 255, 255);
            spriteBatch.Draw(Texture, position, null, color, 0f, new Vector2(0, 0), new Vector2(1f, 1f), SpriteEffects.None, 0f);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Instructor / Trainer Alura Cursos Online
Brazil Brazil

Comments and Discussions