|
Trouver une ressource
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
CHIMERA GAMES ENGINE
Information sur la source
Description
Vue que code-sources n'accepte pas des fichier de taille plus grand que 1Mo j'ai mis a votre disposition WWW.CHIMERA2D.COM Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources Chimera est un moteur de création de jeux vidéo écrit en C#, qui combine Facilité et puissance. Le moteur utilise la librairie XNA qui permet une portabilité (Cross Plateform) entre PC et Xbox360. Ainsi, et avec la richesse que lui porte la POO, Chimera est l'outil dont vous avez besoin pour créer votre jeu vidéo 2D en toute maitrise et simplicité. Chimera 2D est un projet Open Source, ce qui vous offre un accès total au code. Avec son système InteliSense qui vous accompagne dans chaque étape et enrichie votre expérience en offrant des propositions et en proposant de l’aide, Chimera a été conçue pour être facilement maîtrisable par amateurs et professionnels. Le projet Chimera 2D est un projet très particulier pour nous, la team invite tout les développeurs du monde entier à y participer, nous seront open pour toutes suggestions, idées ou propositions.. Quelques Fonctionnalités de Chimera Games Engine 2D : * Moteur Audio : Prend en charge plus de 22 Format différents... * Moteur Physique : Inclue une gestion complète de la physique grâce à l'implémentation du moteur Farseer ainsi que la possibilité d'utiliser des classes propres à Chimera.... * Moteur Graphique : gestion complète des : Image, Sprite, Animation, Effects, BackGround... * Intégration du Moteur De Particule Complet : Mercury.... + Prise En Charge Du GUI : (Graphical User Interface) Window, Label, List, Combo, Text..... o Prise En Charge Des Entrées : Clavier, Souris, GamePad.... o Gestion de profil joueur : Sauvegarde/Chargement... o Gestion Des Scènes du jeu WWW.CHIMERA2D.COM
Source
- //WWW.CHIMERA2D.COM
- //Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
- #region Info/Author
- //----------------------------------------------------------------------------
- // Author: Tazi Mehdi
- // Source: Chimera 2D GAMES ENGINE
- // Info: Image public class : Basic public class
- //-----------------------------------------------------------------------------
- #endregion
- #region Using Statement
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- #endregion
-
- namespace Chimera.Graphics
- {
- /// <summary>
- /// This Class Allow You To Use An Image
- /// </summary>
- public class Image : Helpers.Interface.IDrawable, Helpers.Interface.IDrawables
- {
- /// <summary>
- /// The Default Constructor
- /// </summary>
- public Image()
- {
- //SetOrigin(Chimera.Graphics.Enumeration.EImageOrigin.Center);
- }
- #region Fields(spriteBatch,texture,imgsource,origin,position,size,rotation,color,scale,effects,depth)
-
- private SpriteBatch spriteBatch;
-
- private Texture2D texture;//la texture contient une ou plusieur images
- protected Rectangle imgsource;//X,Y image a dessiner
- protected Vector2 origin; //origine de l'image par defaut : haut agauche
-
- private Vector2 position;
- private Vector2 size;
- private float rotation;
-
- private Color color;
- private Vector2 scale;
- private Vector2 strevect = Vector2.Zero;
- private bool stretch = false;
- private SpriteEffects effects;
- protected float depth;
-
- protected int totalColumns;
- protected int totalRows;
-
- #endregion
- #region Properties(Position,Size,Rotation,Color,Scale)
- /// <summary>
- /// Get Or Set The Image Position
- /// </summary>
- public Vector2 Position
- {
- get { return position; }
- set { position = value; }
- }
- /// <summary>
- /// Get Reference The SpriteBatch
- /// </summary>
- public SpriteBatch SpriteBatch
- {
- get { return this.spriteBatch; }
- }
- /// <summary>
- /// Get Or Set Image Size
- /// </summary>
- public Vector2 Size
- {
- get { return size; }
- set {
- size = value;
- strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
- }
- }
- /// <summary>
- /// Get Reference to Texture2D
- /// </summary>
- public Texture2D Texture
- {
- get { return this.texture;}
- }
- /// <summary>
- /// Get Or Set The Origin Of Image
- /// </summary>
- public Vector2 Origin
- {
- get { return origin; }
- set { origin = value; }
- }
- /// <summary>
- /// Enable Or Disable The Stretch Mode
- /// </summary>
- public bool Stretch
- {
- get { return stretch;}
- set { stretch=value ;}
- }
- /// <summary>
- /// Get Or Set Rotation Degree
- /// </summary>
- public float Rotation
- {
- get { return rotation; }
- set { rotation = value; }
- }
-
- /// <summary>
- /// Get Or Set The Image Depth
- /// </summary>
- public float Depth
- {
- get { return depth; }
- set { depth = value; }
- }
-
- /// <summary>
- /// Get Or Set Image Color
- /// </summary>
- public Color Color
- {
- get { return color; }
- set { color = value; }
- }
-
- /// <summary>
- /// Get Or Set Image Scale Value
- /// </summary>
- public Vector2 Scale
- {
- get { return scale;}
- set { scale = value;}
- }
-
-
- /// <summary>
- /// Get Totals Columns
- /// </summary>
- public int TotalColumns{get { return totalColumns; }}
-
- /// <summary>
- /// Get Total Rows
- /// </summary>
- public int TotalRows{get { return totalRows; }}
- /// <summary>
- /// Get Total Cels
- /// </summary>
- /// <returns></returns>
- public int GetLength(){ return totalColumns * totalRows;}
-
- #endregion
- #region Main Methods (LoadGraphicsContent,Initialize,Draw)
- /// <summary>
- /// Load Graphics Content
- /// </summary>
- /// <param name="spriteBatch">XNA Sprite Batch</param>
- /// <param name="texture">texture to use</param>
- public void LoadGraphicsContent(SpriteBatch spriteBatch, Texture2D texture)
- {
- this.spriteBatch = spriteBatch;
- this.texture = texture;
- }
- /// <summary>
- /// Initalize The Image
- /// </summary>
- /// <param name="size">Image Size</param>
- public virtual void Initialize(Vector2 size)
- {
- this.color = Color.White;
- this.scale = Vector2.One;
- this.effects = SpriteEffects.None;
- this.depth = 0.5f;
- this.size = size;
- this.imgsource = CalculatImgSource(1,1);
- this.totalColumns = this.texture.Width / (int)this.size.X;
- this.totalRows = this.texture.Height / (int)this.size.Y;
- strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
- }
-
- /// <summary>
- /// Draw Image Without Stretch Option
- /// </summary>
-
- public virtual void DefaultDraw()
- {
- this.spriteBatch.Draw(this.texture, this.position, this.imgsource, this.color, this.rotation, this.origin, this.scale, this.effects, this.depth);
- }
- /// <summary>
- /// Draw The Image
- /// </summary>
-
- public virtual void Draw()
- {
- if (this.stretch == false)
- DefaultDraw();
- else
- StretchDraw();
- }
- /// <summary>
- /// Draw Image With Stretch Option
- /// </summary>
-
- public virtual void StretchDraw()
- {
- this.spriteBatch.Draw(this.texture, this.position, new Rectangle(0,0,texture.Width,texture.Height), this.color, this.rotation, this.origin, strevect, this.effects, this.depth);
- }
- #endregion
- #region Additional Functions(CalculatImgSource,SetSourceImage,SetOrigin)
- /// <summary>
- /// Set The Source Image ( If It's Sprite Or Animation )
- /// </summary>
- /// <param name="row">The Row Or The Animation</param>
- /// <param name="column">The Column Or The Frame</param>
- public void SetSourceImage(int row,int column)
- {
- this.imgsource = CalculatImgSource(row,column);
- }
- /// <summary>
- /// Set The Image Origin
- /// </summary>
- /// <param name="_origin">The Image Origin</param>
- public void SetOrigin(Graphics.Enumeration.EImageOrigin _origin)
- {
- if (_origin == Graphics.Enumeration.EImageOrigin.Center)
- {
- origin = new Vector2(this.size.X/2, this.size.Y/2);
- }
- else if (_origin == Graphics.Enumeration.EImageOrigin.RightDownCorner)
- {
- origin = new Vector2(this.size.X,this.size.Y);
- }
- else
- {
- origin = new Vector2(0,0);
- }
- }
-
- /// <summary>
- /// Calculat The Image Source
- /// </summary>
- /// <param name="row">The Row In The Picture</param>
- /// <param name="column">The Column In The Picture</param>
- /// <returns></returns>
- protected Rectangle CalculatImgSource(int row,int column )
- {
-
- int frameWidth = (int)this.size.X;
- int frameHeight = (int)this.size.Y;
-
-
- this.totalColumns = this.texture.Width / frameWidth;
- this.totalRows = this.texture.Height / frameHeight;
-
- if (row > totalRows) row = totalRows;
- if (column > totalColumns) column = totalColumns;
- if (row < 1) row = 1;
- if (column < 1) column = 1;
- int overx = (column - 1) * frameWidth;
- int overy = (row - 1) * frameHeight;
-
- return new Rectangle(overx, overy, frameWidth, frameHeight);
- }
- #endregion
- }
- }
-
//WWW.CHIMERA2D.COM
//Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
#region Info/Author
//----------------------------------------------------------------------------
// Author: Tazi Mehdi
// Source: Chimera 2D GAMES ENGINE
// Info: Image public class : Basic public class
//-----------------------------------------------------------------------------
#endregion
#region Using Statement
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion
namespace Chimera.Graphics
{
/// <summary>
/// This Class Allow You To Use An Image
/// </summary>
public class Image : Helpers.Interface.IDrawable, Helpers.Interface.IDrawables
{
/// <summary>
/// The Default Constructor
/// </summary>
public Image()
{
//SetOrigin(Chimera.Graphics.Enumeration.EImageOrigin.Center);
}
#region Fields(spriteBatch,texture,imgsource,origin,position,size,rotation,color,scale,effects,depth)
private SpriteBatch spriteBatch;
private Texture2D texture;//la texture contient une ou plusieur images
protected Rectangle imgsource;//X,Y image a dessiner
protected Vector2 origin; //origine de l'image par defaut : haut agauche
private Vector2 position;
private Vector2 size;
private float rotation;
private Color color;
private Vector2 scale;
private Vector2 strevect = Vector2.Zero;
private bool stretch = false;
private SpriteEffects effects;
protected float depth;
protected int totalColumns;
protected int totalRows;
#endregion
#region Properties(Position,Size,Rotation,Color,Scale)
/// <summary>
/// Get Or Set The Image Position
/// </summary>
public Vector2 Position
{
get { return position; }
set { position = value; }
}
/// <summary>
/// Get Reference The SpriteBatch
/// </summary>
public SpriteBatch SpriteBatch
{
get { return this.spriteBatch; }
}
/// <summary>
/// Get Or Set Image Size
/// </summary>
public Vector2 Size
{
get { return size; }
set {
size = value;
strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
}
}
/// <summary>
/// Get Reference to Texture2D
/// </summary>
public Texture2D Texture
{
get { return this.texture;}
}
/// <summary>
/// Get Or Set The Origin Of Image
/// </summary>
public Vector2 Origin
{
get { return origin; }
set { origin = value; }
}
/// <summary>
/// Enable Or Disable The Stretch Mode
/// </summary>
public bool Stretch
{
get { return stretch;}
set { stretch=value ;}
}
/// <summary>
/// Get Or Set Rotation Degree
/// </summary>
public float Rotation
{
get { return rotation; }
set { rotation = value; }
}
/// <summary>
/// Get Or Set The Image Depth
/// </summary>
public float Depth
{
get { return depth; }
set { depth = value; }
}
/// <summary>
/// Get Or Set Image Color
/// </summary>
public Color Color
{
get { return color; }
set { color = value; }
}
/// <summary>
/// Get Or Set Image Scale Value
/// </summary>
public Vector2 Scale
{
get { return scale;}
set { scale = value;}
}
/// <summary>
/// Get Totals Columns
/// </summary>
public int TotalColumns{get { return totalColumns; }}
/// <summary>
/// Get Total Rows
/// </summary>
public int TotalRows{get { return totalRows; }}
/// <summary>
/// Get Total Cels
/// </summary>
/// <returns></returns>
public int GetLength(){ return totalColumns * totalRows;}
#endregion
#region Main Methods (LoadGraphicsContent,Initialize,Draw)
/// <summary>
/// Load Graphics Content
/// </summary>
/// <param name="spriteBatch">XNA Sprite Batch</param>
/// <param name="texture">texture to use</param>
public void LoadGraphicsContent(SpriteBatch spriteBatch, Texture2D texture)
{
this.spriteBatch = spriteBatch;
this.texture = texture;
}
/// <summary>
/// Initalize The Image
/// </summary>
/// <param name="size">Image Size</param>
public virtual void Initialize(Vector2 size)
{
this.color = Color.White;
this.scale = Vector2.One;
this.effects = SpriteEffects.None;
this.depth = 0.5f;
this.size = size;
this.imgsource = CalculatImgSource(1,1);
this.totalColumns = this.texture.Width / (int)this.size.X;
this.totalRows = this.texture.Height / (int)this.size.Y;
strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
}
/// <summary>
/// Draw Image Without Stretch Option
/// </summary>
public virtual void DefaultDraw()
{
this.spriteBatch.Draw(this.texture, this.position, this.imgsource, this.color, this.rotation, this.origin, this.scale, this.effects, this.depth);
}
/// <summary>
/// Draw The Image
/// </summary>
public virtual void Draw()
{
if (this.stretch == false)
DefaultDraw();
else
StretchDraw();
}
/// <summary>
/// Draw Image With Stretch Option
/// </summary>
public virtual void StretchDraw()
{
this.spriteBatch.Draw(this.texture, this.position, new Rectangle(0,0,texture.Width,texture.Height), this.color, this.rotation, this.origin, strevect, this.effects, this.depth);
}
#endregion
#region Additional Functions(CalculatImgSource,SetSourceImage,SetOrigin)
/// <summary>
/// Set The Source Image ( If It's Sprite Or Animation )
/// </summary>
/// <param name="row">The Row Or The Animation</param>
/// <param name="column">The Column Or The Frame</param>
public void SetSourceImage(int row,int column)
{
this.imgsource = CalculatImgSource(row,column);
}
/// <summary>
/// Set The Image Origin
/// </summary>
/// <param name="_origin">The Image Origin</param>
public void SetOrigin(Graphics.Enumeration.EImageOrigin _origin)
{
if (_origin == Graphics.Enumeration.EImageOrigin.Center)
{
origin = new Vector2(this.size.X/2, this.size.Y/2);
}
else if (_origin == Graphics.Enumeration.EImageOrigin.RightDownCorner)
{
origin = new Vector2(this.size.X,this.size.Y);
}
else
{
origin = new Vector2(0,0);
}
}
/// <summary>
/// Calculat The Image Source
/// </summary>
/// <param name="row">The Row In The Picture</param>
/// <param name="column">The Column In The Picture</param>
/// <returns></returns>
protected Rectangle CalculatImgSource(int row,int column )
{
int frameWidth = (int)this.size.X;
int frameHeight = (int)this.size.Y;
this.totalColumns = this.texture.Width / frameWidth;
this.totalRows = this.texture.Height / frameHeight;
if (row > totalRows) row = totalRows;
if (column > totalColumns) column = totalColumns;
if (row < 1) row = 1;
if (column < 1) column = 1;
int overx = (column - 1) * frameWidth;
int overy = (row - 1) * frameHeight;
return new Rectangle(overx, overy, frameWidth, frameHeight);
}
#endregion
}
}
Conclusion
WWW.CHIMERA2D.COM Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
Sources du même auteur
Sources de la même categorie
Sources en rapport avec celle ci
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Modification suite à l'installation de XNA [ par Frederick_Etudiant ]
Bonjour et bonne année à tous,J'ai installé Microsoft Visual C# 2005 Express Edition, puis XNA game express 1.0J'ai ensuite voulu recommencer les tut
Tutoriels pour XNA [ par Frederick_Etudiant ]
XNA est passé à une nouvelle version en décembre 2006.Le problème est que tout les tutoriels, que j'ai trouvés, ne marche que sur la version béta.Quel
Texture2D Xna Framework [ par oualla_mohamed ]
Salut à tous,Je suis entain de m'initier au Xna Framework.J'ai une texture 2d que j'affiche complétement avec un effet de zoom ( ex: 0.5 , 2 ,2.5).J'
Un blog de développement de jeux video sous XNA [ par MaxSoldier ]
Tout est dans le titre ou presque. Mon équipe et moi créeons en ce moment un site sur la programmation de jeux video grâce à XNA. Les tutoriaux sont f
XNA Error [ par T_Mehdi ]
bonjour tout le monde :)j'ai une drole d'erreur , je mexpliqueLorsque j'essey d'executer un executable realisé sous XNA sur n'importe quelle machine c
xna shoot [ par noun29 ]
Bonjour j'essaye de developper un shmup en xna mais je commence juste avec ce langage. J'ai reussi a faire un vaisseau que l'on peux deplacer avec le
Cherche blogueur XNA [ par MaxSoldier ]
Bonjours à tous !J'avais monté un blog il y a quelque temps que j'ai du abandonner. Il parlait de développement XNA et offrait aux débutants des tutor
XNA et audio [ par gabs77 ]
Bonsoir,je suis en train de faire un jeu en xna pour m'amuser un petit peu et je cherche à intéger de l'audio.j'ai vu quelques tuto qui parle de 3 cla
[XNA] Mon projet n'est plus compatible sur les autres PC !! [ par daikyo ]
Bonjour, Je rencontre un petit problème concernant le partage de mon projet, je souhaite envoyer le "Debug" ou même la "Release" comme je le fais depu
Exportations de projets XNA [ par nfs65 ]
Bonjour,Je me suis attaqué depuis peu à XNA, j'ai installé des tous les composants comme expliqué sur XNA Creator, donc tout fonctionne parfaitement c
|
Téléchargements
Logiciels à télécharger sur le même thème :
|