本文整理汇总了C#中Screen类的典型用法代码示例。如果您正苦于以下问题:C# Screen类的具体用法?C# Screen怎么用?C# Screen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Screen类属于命名空间,在下文中一共展示了Screen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScreenFadeOutTransition
public ScreenFadeOutTransition(Screen screen, Color color, bool queue = true, float speed = 0.05f, Action onBegin = null, Action onEnd = null)
: base(screen, queue, speed, onBegin, onEnd)
{
_color = color;
_screen = screen;
_pixel = ResourceManager.getTexture("pixel");
}
示例2: InsertScreen
//make a screen in db
internal int InsertScreen(Screen scrn)
{
int result = 0;
try
{ //noOfSeats is the number of seats in a row
//12 rows, 8 seats pr. row
dbConn.Open();
SqlCommand command = new SqlCommand(("INSERT INTO CinemaScreen (screenNo, noOfRows, noOfSeats) VALUES ((@screenNo), (@noOfRows), (@noOfSeats))"), dbConn);
command.Parameters.Add("@screenNo", SqlDbType.Int).Value = scrn.screenNo;
command.Parameters.Add("@noOfRows", SqlDbType.Int).Value = scrn.numberOfRows;
command.Parameters.Add("@noOfSeats", SqlDbType.Int).Value = scrn.numberOfSeatsInARow;
result = command.ExecuteNonQuery();
}
catch (SqlException)
{
throw;
}
finally
{
dbConn.Close();
}
return result;
}
示例3: modeSelect
public void modeSelect()
{
modeScreen = new ModeScreen(this);
currentScreen = Screen.ModeScene;
startScreen = null;
}
示例4: ScreenInput
public ScreenInput(Screen screen, SpriteFont Font, String Command)
: base(screen)
{
this.Font = Font;
this.Size.Y = Font.LineSpacing;
this.Command = Command;
}
示例5: Insert
///<summary>Inserts one Screen into the database. Returns the new priKey.</summary>
internal static long Insert(Screen screen)
{
if(DataConnection.DBtype==DatabaseType.Oracle) {
screen.ScreenNum=DbHelper.GetNextOracleKey("screen","ScreenNum");
int loopcount=0;
while(loopcount<100){
try {
return Insert(screen,true);
}
catch(Oracle.DataAccess.Client.OracleException ex){
if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
screen.ScreenNum++;
loopcount++;
}
else{
throw ex;
}
}
}
throw new ApplicationException("Insert failed. Could not generate primary key.");
}
else {
return Insert(screen,false);
}
}
示例6: quitGame
public void quitGame()
{
startScreen = new StartScreen(this);
currentScreen = Screen.StartScreen;
gameScreen = null;
scoreboardScreen = null;
}
示例7: Mouseclik
public Screen Mouseclik(int x, int y)
{
Rectangle mouserec = new Rectangle(x, y, 10, 10);
if (mouserec.Intersects(world1rect))
{
current = Screen.ChooseLevelScreen;
return (current);
}
else if (mouserec.Intersects(world2rect))
{
current = Screen.ChooseLevelScreen2;
return (current);
}
else if (mouserec.Intersects(world3rect))
{
current = Screen.ChooseLevelScreen3;
return (current);
}
else if (mouserec.Intersects(backbuttonw))
{
current = Screen.StartScreen;
return (current);
}
return (current);
}
示例8: Pane
// Constructor for custom pane textures
public Pane(
Screen screen,
Texture2D topLeftCorner,
Texture2D topRightCorner,
Texture2D bottomRightCorner,
Texture2D bottomLeftCorner,
Texture2D leftSide,
Texture2D topSide,
Texture2D rightSide,
Texture2D bottomSide,
Texture2D background,
UIAlignment alignment,
int x,
int y,
int width,
int height)
{
_screen = screen;
_spriteBatch = _screen.screenSystem.spriteBatch;
_topLeftCorner = topLeftCorner;
_topRightCorner = topRightCorner;
_bottomRightCorner = bottomRightCorner;
_bottomLeftCorner = bottomLeftCorner;
_leftSide = leftSide;
_topSide = topSide;
_rightSide = rightSide;
_bottomSide = bottomSide;
_background = background;
_alignment = alignment;
_xOffset = x;
_yOffset = y;
_width = width;
_height = height;
}
示例9: ScreenTextureSelector
/// <summary>
/// The constructor for this selector.
/// </summary>
public ScreenTextureSelector(Engine engine, Screen screen)
: base(screen)
{
// Adds the page forward and back buttons to the screen.
int _buttonHeight = screen.GetTotalElementHeight();
ScreenButton _but = new ScreenButton(screen, "Back", "<", engine.FontMain);
_but.Position.X = Screen.boarderSize;
_but.Size.X = 32;
_but.Position.Y = _buttonHeight;
screen.ElementList.Add(_but);
_but = new ScreenButton(screen, "Forward", ">", engine.FontMain);
_but.Position.X = Screen.boarderSize + 32 + Screen.boarderSize;
_but.Size.X = 32;
_but.Position.Y = _buttonHeight;
screen.ElementList.Add(_but);
// Creates a new input field and adds it to the screen.
this.InputField = new ScreenInput(screen, engine.FontMain);
screen.AddElement(InputField);
// Resizes and places the bread and butter of this element.
this.Position.Y = screen.GetTotalElementHeight();
this.Size.Y = 128;
// Determines the max rows and columns that will fit.
this.PrevMaximumColumns = (int)Math.Floor(Size.X / TilePreviewSize);
this.PrevMaximumRows = (int)Math.Floor(Size.Y / TilePreviewSize);
// Creates new lists to display.
FilterTiles(engine);
}
示例10: ParentItemIsUnsetOnRemovedConductedItem
public void ParentItemIsUnsetOnRemovedConductedItem() {
var conductor = new Conductor<IScreen>.Collection.OneActive();
var conducted = new Screen();
conductor.Items.Add(conducted);
conductor.Items.RemoveAt(0);
Assert.NotEqual(conductor, conducted.Parent);
}
开发者ID:bartenders,项目名称:EnterpriseProjectTemplate,代码行数:7,代码来源:ConductorWithCollectionOneActiveTests.cs
示例11: LabelTextureButton
public LabelTextureButton(
Screen screen,
SpriteBatch spriteBatch,
UIAlignment alignment,
int x,
int y,
Texture2D selectedTexture,
Texture2D deselectedTexture,
Rectangle localHitBox,
SpriteFont font,
TextAlignment textAlignment,
string text,
int textXOffset,
int textYOffset,
int outline,
Color selectedColor,
Color deselectedColor,
Action onActivate,
Action onMouseOver,
Action onMouseOut)
: base(screen, spriteBatch, alignment, x, y, selectedTexture, deselectedTexture, localHitBox, onActivate, onMouseOver, onMouseOut)
{
_font = font;
_textAlignment = textAlignment;
_text = text;
_textXOffset = textXOffset;
_textYOffset = textYOffset;
_outline = outline;
_selectedColor = selectedColor;
_deselectedColor = deselectedColor;
}
示例12: BasicCore
public BasicCore(Game1 game)
{
this.game = game;
this.screen = new Screen();
this.content = new ContentHandler(this.game.Content);
this.r = new Registry();
}
示例13: CalculateRealScreenPosition
private void CalculateRealScreenPosition(Screen screen, Vector intersection)
{
CursorPositionX += (intersection.x * screen.WidthPixels - CursorPositionX) * VelocityResponse;
CursorPositionY += ((1 - intersection.y) * screen.HeightPixels - CursorPositionY) * VelocityResponse;
mouseFacade.SetCursorPosition((int)CursorPositionX, (int)CursorPositionY);
}
示例14: Draw
public override void Draw(Screen screen)
{
if(Parent is Level)
{
base.Draw(screen);
}
}
示例15: ReadAndRenderFile
public void ReadAndRenderFile ( string _filename )
{
IAnsiDecoder vt100 = new AnsiDecoder();
//vt100.Encoding = encodingInfo.GetEncoding (); // encodingInfo.Name, new EncoderExceptionFallback(), new DecoderReplacementFallback ("U") );
Screen screen = new Screen ( 80, 160 );
vt100.Subscribe ( screen );
using ( BinaryReader reader = new BinaryReader(File.Open(_filename, FileMode.Open)) )
{
try
{
int read = 0;
while ( (read = reader.Read()) != -1 )
{
vt100.Input ( new byte[] { (byte) read } );
}
}
catch ( EndOfStreamException )
{
}
}
System.Console.Write ( screen.ToString() );
Bitmap bitmap = screen.ToBitmap ( new Font("Courier New", 10) );
bitmap.Save ( _filename + ".png", System.Drawing.Imaging.ImageFormat.Png );
}