Changeset 2781
- Timestamp:
- 2012-06-04 21:54:25 (11 years ago)
- Location:
- 2012/23/RamiP/YAG2DSSBase/YAG2DSS
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/ALTKHandler.cs
r2778 r2781 28 28 public static StaticAnimHandler StaticAnimHandler; 29 29 public static GUI.Dialogs.ExitWindow ExitWindow; 30 public static GUI.AMessageDisplay MessageDisplay; 30 31 31 32 /// <summary> … … 55 56 ExitWindow.Enabled = false; 56 57 Game.Components.Add(ExitWindow); 58 59 MessageDisplay = new GUI.AMessageDisplay(Game); 60 MessageDisplay.backgroundTextureColor = new Color(0, 192, 0, 128); 61 MessageDisplay.TextColor = Color.Blue; 62 MessageDisplay.FontPath = "aMainFont"; 63 MessageDisplay.UpdateFont(""); 64 MessageDisplay.Initialize(); 65 MessageDisplay.CreateBackgroundTexture(ALTKConstants.WindowWidth); 66 Game.Components.Add(MessageDisplay); 67 57 68 } 58 69 -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/GUI/AMessageDisplay.cs
r2768 r2781 44 44 public string FontPath = "aMessageFont"; 45 45 46 public Texture2D Texture;47 46 public Texture2D CommonItemTexture; 48 47 … … 54 53 55 54 public Color TextColor = Color.Red; 56 public Color TextColorPressed = Color.Green;57 public Color TextColorCurrent = Color.Red;58 55 public Color BackgroundColor = new Color(new Vector4(255, 180, 180, 75)); 59 56 … … 64 61 65 62 public int StartFromItem = 0; 66 67 public SoundEffect soundEffect;68 public SoundEffectInstance soundInstance;69 63 70 64 public float TargetElapsedTime = 1.0f; … … 192 186 public void UpdateFont(string Modpath) 193 187 { 194 spriteFont = content.Load<SpriteFont>(Environment.CurrentDirectory + "\\" + Modpath + "\\Content\\" + FontPath);188 spriteFont = ALTKHandler.Loader.loadFont("aMainFont"); 195 189 } 196 190 -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/GUI/AUIButton.cs
r2778 r2781 105 105 if (textSize.X < Width) 106 106 { 107 TextXAdd = Convert.ToInt32(( Width - textSize.X) / 2);107 TextXAdd = Convert.ToInt32(((Width - textSize.X) / 2) - (textSize.X / 4)); 108 108 //TextXAdd = Convert.ToInt32((textSize.X - Width) / -2); 109 109 } -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/GUI/Dialogs/ExitWindow.cs
r2778 r2781 35 35 AUIButton BExit; 36 36 AUIButton BCancel; 37 AUIButton LCaption; 37 38 38 39 /// <summary> … … 58 59 BExit = new AUIButton(Game); 59 60 BExit.FontPath = "aMainFont"; 61 BExit.AlphaRate = BExit.AlphaRate / 2.0f; 60 62 BExit.UpdateFont(""); 61 63 BExit.AdaptiveSize = true; … … 68 70 BExit.Height = 30; 69 71 BExit.IdleTexture = CreateTexture(200, 30, 70 new Color(0, 102, 255, 196),72 new Color(0, 51, 128, 128), 71 73 new Color(102, 0, 153, 255), 72 74 new Color(0, 0, 255, 168)); … … 77 79 BExit.Initialize(); 78 80 81 BCancel = new AUIButton(Game); 82 BCancel.FontPath = "aMainFont"; 83 BCancel.AlphaRate = BCancel.AlphaRate / 2.0f; 84 BCancel.UpdateFont(""); 85 BCancel.AdaptiveSize = false; 86 BCancel.ButtonText = "Minä haluan jatkaa! =///"; 87 BCancel.PositionY = 150.0f; 88 BCancel.PositionX = 100.0f; 89 BCancel.TextColor = Color.Blue; 90 BCancel.TextColorPressed = Color.Teal; 91 BCancel.Width = 200; 92 BCancel.Height = 30; 93 BCancel.IdleTexture = CreateTexture(200, 30, 94 new Color(0, 51, 128, 128), 95 new Color(102, 0, 153, 255), 96 new Color(0, 0, 255, 168)); 97 BCancel.HoverTexture = CreateTexture(200, 30, 98 new Color(0, 255, 153, 196), 99 new Color(0, 0, 255, 255), 100 new Color(102, 0, 153, 196)); 101 BCancel.Initialize(); 102 103 // Caption (haluatko nyt siis IHAN varmasti poistua??? ='((((( ) 104 LCaption = new AUIButton(Game); 105 LCaption.FontPath = "aMainFont"; 106 LCaption.UpdateFont(""); 107 LCaption.AdaptiveSize = false; 108 LCaption.ButtonText = "Haluatko nyt siis IHAN varmasti poistua?? ='(((("; 109 LCaption.PositionX = 10.0f; 110 LCaption.PositionY = 20.0f; 111 //LCaption.TextColor = Color.Teal; 112 LCaption.TextColorCurrent = Color.Teal; 113 LCaption.Width = 390; 114 LCaption.Height = 40; 115 LCaption.Initialize(); 79 116 //BExit.IdleTexture.SaveAsPng(System.IO.File.Create(Environment.CurrentDirectory + "\\texture.png"), 200, 30); 80 117 //Environment.Exit(0); … … 199 236 BExit.Update(gameTime, sizePos.X, sizePos.Y); 200 237 238 if (BExit.NeedsUpdating) 239 Environment.Exit(0); 240 241 BCancel.Update(gameTime, sizePos.X, sizePos.Y); 242 243 if (BCancel.NeedsUpdating) 244 { 245 BCancel.NeedsUpdating = false; 246 Cursor.enableBasicInput = true; 247 Enabled = false; 248 Visible = false; 249 } 250 201 251 base.Update(gameTime); 202 252 } … … 211 261 212 262 BExit.Draw(gameTime, sizePos.X, sizePos.Y); 263 BCancel.Draw(gameTime, sizePos.X, sizePos.Y); 264 LCaption.Draw(gameTime, sizePos.X, sizePos.Y); 213 265 214 266 base.Draw(gameTime); -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSS/YAG2DSS.cs
r2778 r2781 18 18 public override void Begin() 19 19 { 20 // TODO: Kirjoita ohjelmakoodisi tähä21 22 20 Kursori = new GameObject(32, 32); 23 21 Kursori.Image = Image.FromStream(File.OpenRead(ALTKConstants.TexturePath + "cursor.png")); … … 46 44 //AddCollisionHandler(po, 47 45 po.Hit(new Vector(500.0, 0.0)); 48 49 50 46 } 51 47 … … 91 87 { 92 88 base.Update(gameTime); 89 90 ALTKHandler.MessageDisplay.AddItem("Trololollolollololoo, lololololooo..."); 91 92 if (Kursori.Position.X > ALTKConstants.WindowWidth / 2.0) 93 Kursori.MoveTo(new Vector(ALTKConstants.WindowWidth / 2.0, Kursori.Position.Y), 1000000.0); 94 else if (Kursori.Position.X < ALTKConstants.WindowWidth / -2.0) 95 Kursori.MoveTo(new Vector(ALTKConstants.WindowWidth / -2.0, Kursori.Position.Y), 1000000.0); 96 97 if (Kursori.Position.Y > ALTKConstants.WindowHeight / 2.0) 98 Kursori.MoveTo(new Vector(Kursori.Position.X, ALTKConstants.WindowHeight / 2.0), 1000000.0); 99 else if (Kursori.Position.Y < ALTKConstants.WindowHeight / -2.0) 100 Kursori.MoveTo(new Vector(Kursori.Position.X, ALTKConstants.WindowHeight / -2.0), 1000000.0); 93 101 94 102 ALTK.Cursor.SecPosX = Convert.ToInt32((ALTKConstants.WindowWidth / 2) + Kursori.Position.X); … … 159 167 } 160 168 } 169 170 161 171 } -
2012/23/RamiP/YAG2DSSBase/YAG2DSS/YAG2DSSContent/Fonts/aMainFont.xml
r2768 r2781 3 3 <Asset Type="Graphics:FontDescription"> 4 4 <FontName>Segoe UI</FontName> 5 <Size>1 2</Size>6 <Spacing> 2</Spacing>5 <Size>13</Size> 6 <Spacing>1</Spacing> 7 7 <Style>Regular</Style> 8 8 <DefaultCharacter>?</DefaultCharacter>
Note: See TracChangeset
for help on using the changeset viewer.