Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > .NET Frameworks (точка нет фреймворки) > C# (си шарп)
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 16.02.2014, 17:07   #1
Smail95
 
Регистрация: 16.02.2014
Сообщений: 7
По умолчанию Спрайты

Помогите разобраться с созданием и выводом спрайтов на C#.
Smail95 вне форума Ответить с цитированием
Старый 16.02.2014, 17:53   #2
Streletz
Старожил
 
Регистрация: 03.01.2014
Сообщений: 2,870
Вопрос

Простите, а с чем помогать? Где наработки с описанием проблемы?
Streletz вне форума Ответить с цитированием
Старый 17.02.2014, 06:57   #3
Smail95
 
Регистрация: 16.02.2014
Сообщений: 7
По умолчанию

Код:
using System;
using System.Collections.Generic;
using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Environment;
using Sce.PlayStation.Core.Graphics;
using Sce.PlayStation.Core.Input;
using Sce.PlayStation.Core.Imaging;

namespace Application
{
	public class AppMain
	{
		private static GraphicsContext graphics;
		private static Sprite Demo;
		
		public static void Main ()
		{
			Initialize ();

			while (true) {
				SystemEvents.CheckEvents ();
				Update ();
				Render ();
			}
		}

		public static void Initialize ()
		{ 
			// Set up the graphics system
			graphics = new GraphicsContext();
			Texture2D t = new Texture2D("/Application/assents/Demo.png", false);
			Demo = new Sprite(graphics, t);
			Demo.Position.X = graphics.Screen.Rectangle.Width / 2;
			Demo.Position.Y = graphics.Screen.Rectangle.Height / 2;
		
		}

		public static void Update ()
		{
			// Query gamepad for current state
			var gamePadData = GamePad.GetData (0);
		}

		public static void Render ()
		{
			// Clear the screen
			graphics.SetClearColor (0.0f, 1.0f, 1.0f, 0.0f);
			graphics.Clear ();
//			ship.render();
			// Present the screen
	

		}
	}
}
Это основной файл.

Код:
using System;
using System.Collections.Generic;
using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Environment;
using Sce.PlayStation.Core.Graphics;
using Sce.PlayStation.Core.Input;
using Sce.PlayStation.Core.Imaging;

namespace Application
{
	public class Sprite
	{
		public Sprite(Texture2D texture, float positionX, float positionY, float degree = 0.0f, float scale = 1.0f)
    {
        SetTexture(texture);
        SetDrawRect(0, 0, texture.Width, texture.Height);

        PositionX = positionX;
        PositionY = positionY;

		}
	}
}
Это файл спрайта. Разъясните косяки.
Smail95 вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Спрайты Kors07 C# (си шарп) 1 21.05.2011 01:03
Спрайты Skrip Gamedev - cоздание игр: Unity, OpenGL, DirectX 2 11.05.2011 10:37
DirectX спрайты на билдэре... ALKOrobot C++ Builder 0 16.04.2011 11:36
Спрайты в QBasic dante2010 Помощь студентам 1 01.10.2010 23:59