//クリックの画像変更とか、clicknumberの変更してくれる,Object生成はClickSystem protected void TextureSystem() { if (asd.Engine.Mouse.LeftButton.ButtonState == (asd.MouseButtonState.Push)) { if (ClickSystem.Select() == TextureNum) { if (ClickSystem.ClickedNumber == TextureNum) { return; } //画像クリックで透明化 asd.Engine.Sound.Play(Click); Color = new asd.Color(255, 255, 255, 100); ClickSystem.ClickedNumber = TextureNum; } else if (ClickSystem.Select() == -1 || ClickSystem.Select() == -2) { //画像そのまま } else { Color = new asd.Color(255, 255, 255, 255); } } }
/// <summary> /// <see cref="Button_D_Register"/>クリック時の挙動 /// </summary> private void Button_D_Register_Click(object sender, EventArgs e) { var fontsize = (int)NumericUpDown_D_Size.Value; var fontcolor = new asd.Color((int)NumericUpDown_D_FR.Value, (int)NumericUpDown_D_FG.Value, (int)NumericUpDown_D_FB.Value, (int)NumericUpDown_D_FA.Value); var outlinesize = (int)NumericUpDown_D_OutLineSize.Value; var outlinecolor = new asd.Color((int)NumericUpDown_D_OR.Value, (int)NumericUpDown_D_OG.Value, (int)NumericUpDown_D_OB.Value, (int)NumericUpDown_D_OA.Value); var path = TextBox_Path_D.Text; DynamicFontInfo fontinfo; if (!asd.Engine.File.Exists(path)) { Console.WriteLine("FilePath Is Wrong"); return; } try { fontinfo = DynamicFontInfo.GetInstance(path, fontsize, fontcolor, outlinesize, outlinecolor); } catch (System.IO.IOException) { Console.WriteLine("Failed to create font"); return; } if (DataBase.Fonts.Contains(fontinfo)) { Console.WriteLine("Font is duplicated"); return; } DataBase.Fonts.Add(fontinfo); Console.WriteLine("Succeeded to create font"); FormReset_D(); ResetListView(true); ResetComboBox(); }
public FeverWarp(Player playerRef, GameScene scene) { player = playerRef; gscene = scene; //Texture = asd.Engine.Graphics.CreateTexture2D("Resources/DarkBall.png"); // Texture = asd.Engine.Graphics.CreateTexture2D("Resources/WarpHole.png"); Texture = asd.Engine.Graphics.CreateTexture2D("Resources/WarpHole2.png"); Scale = new asd.Vector2DF(2.0f, 2.0f); Color = new asd.Color(200, 200, 200, 200); Radius = Texture.Size.X / 8; CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); while (true) { asd.Vector2DF pos = new asd.Vector2DF(Texture.Size.X / 2 + rand.Next(0, 6) * (asd.Engine.WindowSize.X / 9), Texture.Size.Y / 2 + rand.Next(0, 10) * (asd.Engine.WindowSize.Y / 10)); if ((player.Position - pos).Length > Radius) { Position = pos; break; } } Src = new asd.RectF(0, 0, 0, 0); }
private static IControllerButton CreateButton(int index, float x, float y) { var defaultColor = new asd.Color(150, 150, 150); var hoverColor = new asd.Color(255, 255, 255); //var holdColor = new asd.Color(50, 50, 50); var stage_button = new asd.TextureObject2D(); stage_button.Texture = asd.Engine.Graphics.CreateTexture2D($"Resources/stage{index}.png"); var size = new asd.Vector2DF(250.0f, 75.0f); var buttonArea = new asd.RectF(-size / 2.0f, size); var buttonObj = new asd.TextureObject2D() { Texture = asd.Engine.Graphics.CreateTexture2D($"Resources/stage{index}.png") , Color = defaultColor , CenterPosition = new asd.Vector2DF(stage_button.Texture.Size.X / 2.0f, stage_button.Texture.Size.Y / 2.0f) , Position = asd.Engine.WindowSize.To2DF() / 2.0f + (new asd.Vector2DF(x, y)) } ; var button = new ControllerButtonComponent <asd.TextureObject2D>("Button"); //button.DefaultEvent += owner => { }; //button.HoverEvent += owner => { }; //button.HoldEvent += owner => { }; button.OnEnteredEvent += owner => { Console.WriteLine("Button{0}: OnEntered", index); owner.Color = hoverColor; }; button.OnPushedEvent += owner => { Console.WriteLine("Button{0}: OnPushed", index); asd.Engine.ChangeSceneWithTransition(new CharSelectScene(index), new asd.TransitionFade(1.0f, 1.0f)); owner.Color = hoverColor; }; button.OnReleasedEvent += owner => { Console.WriteLine("Button{0}: OnReleased", index); owner.Color = hoverColor; }; button.OnExitedEvent += owner => { Console.WriteLine("Button{0}: OnExited", index); owner.Color = defaultColor; }; buttonObj.AddComponent(button, button.Name); return(button); }
internal void DrawSpriteAdditionally_(asd.Vector2DF upperLeftPos, asd.Vector2DF upperRightPos, asd.Vector2DF lowerRightPos, asd.Vector2DF lowerLeftPos, asd.Color upperLeftCol, asd.Color upperRightCol, asd.Color lowerRightCol, asd.Color lowerLeftCol, asd.Vector2DF upperLeftUV, asd.Vector2DF upperRightUV, asd.Vector2DF lowerRightUV, asd.Vector2DF lowerLeftUV, asd.Texture2D texture, asd.AlphaBlendMode alphaBlend, int priority) { base.DrawSpriteAdditionally(upperLeftPos, upperRightPos, lowerRightPos, lowerLeftPos, upperLeftCol, upperRightCol, lowerRightCol, lowerLeftCol, upperLeftUV, upperRightUV, lowerRightUV, lowerLeftUV, texture, alphaBlend, priority); }
public TextureObject2DNormalMap() : base(Utils.Path.NormalMap) { ZPos = 0.0f; Light0 = LightType.Directional(new asd.Vector3DF(0.0f, 0.0f, -1.0f)); LightColor0 = new asd.Color(255, 255, 255, 255); }
public void SetColor(asd.Color color) { foreach (var c in Charas) { c.Value.Color = color; } }
public TestPlayer(asd.Vector2DF pos) { Texture = asd.Engine.Graphics.CreateTexture2D("PlayerUp.png"); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); Scale = new asd.Vector2DF((float)Program.ObjWidth / (float)Texture.Size.X, (float)Program.ObjWidth / (float)Texture.Size.Y); Color = new asd.Color(255, 255, 255, 180);//透明感出したい Position = pos; }
/// <summary> /// StageMakerで使用 /// </summary> /// <param name="pos"></param> /// <param name="warpPos"></param> public WarpTexture(asd.Vector2DF pos) { Texture = asd.Engine.Graphics.CreateTexture2D("WarpZone.png"); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); Scale = 1.2f * new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, (float)Program.CellLarge / (float)Texture.Size.Y); Color = new asd.Color(255, 255, 255, 100);//透明感出したい Position = pos; }
/// <summary> /// 最後の引数が大きいと一瞬で消える /// </summary> /// <param name="pos"></param> /// <param name="text"></param> /// <param name="large">フォント大きさ</param> /// <param name="mainColor"></param> /// <param name="aroundLarge">フォント周囲大きさ</param> /// <param name="aroundColor"></param> /// <param name="fadeOutTime">fadeoutの速さ</param> public VanishingText(asd.Vector2DF pos, String text, int large, asd.Color mainColor, int aroundLarge, asd.Color aroundColor, byte fadeOutTime) : base(pos, text, large, mainColor, aroundLarge, aroundColor) { FadeOutCount = 255; mainColor.A = 255; Color = mainColor; FadeOutTime = fadeOutTime; }
private static IControllerButton CreateButton(PlayerType type, float x, float y, List <PlayerType> list) { var defaultColor = new asd.Color(150, 150, 150); var hoverColor = new asd.Color(255, 255, 255); //var holdColor = new asd.Color(50, 50, 50); var stage_button = new asd.TextureObject2D(); stage_button.Texture = asd.Engine.Graphics.CreateTexture2D($"Resources/{type.ToString()}Player.png"); var size = new asd.Vector2DF(250.0f, 75.0f); var buttonArea = new asd.RectF(-size / 2.0f, size); var buttonObj = new asd.TextureObject2D() { Texture = asd.Engine.Graphics.CreateTexture2D($"Resources/{type.ToString()}Player.png") , Color = defaultColor , CenterPosition = new asd.Vector2DF(stage_button.Texture.Size.X / 2.0f, stage_button.Texture.Size.Y / 2.0f) , Position = asd.Engine.WindowSize.To2DF() / 2.0f + (new asd.Vector2DF(x, y)) } ; var button = new ControllerButtonComponent <asd.TextureObject2D>("Button"); //button.DefaultEvent += owner => { }; //button.HoverEvent += owner => { }; //button.HoldEvent += owner => { }; button.OnEnteredEvent += owner => { owner.Color = hoverColor; }; button.OnPushedEvent += owner => { //asd.Engine.ChangeSceneWithTransition(new GameScene(type, stage), new asd.TransitionFade(1.0f, 1.0f)); list.Add(type); owner.Color = hoverColor; }; button.OnReleasedEvent += owner => { owner.Color = hoverColor; }; button.OnExitedEvent += owner => { owner.Color = defaultColor; }; buttonObj.AddComponent(button, button.Name); return(button); }
public GeneralText(asd.Vector2DF pos, String text, int large, asd.Color mainColor, int aroundLarge, asd.Color aroundColor) { Font = asd.Engine.Graphics.CreateDynamicFont("Font.ttf", large, mainColor, aroundLarge, aroundColor); Position = pos; Text = text; var size = Font.CalcTextureSize(Text, asd.WritingDirection.Horizontal); CenterPosition = size.To2DF() / 2; }
public BackGround() { BackGroundColor = new asd.Color(242, 220, 223, 255); Color = BackGroundColor; var rect = new asd.RectangleShape(); rect.DrawingArea = new asd.RectF(0, 0, Program.WindowSizeX, Program.WindowSizeY); Shape = rect; }
public Goal(asd.Vector2DF pos) : base() { Position = pos; Texture = asd.Engine.Graphics.CreateTexture2D("goal.png"); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); Color = new asd.Color(255, 255, 255, 200);//透明感出したい Scale = 1.5f * new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, (float)Program.CellLarge / (float)Texture.Size.Y); }
public Button(string text, float x, float y, int fontsize, asd.Color color) { font = asd.Engine.Graphics.CreateDynamicFont(string.Empty, fontsize, color, 1, new asd.Color(255, 255, 255, 255)); Font = font; size = font.CalcTextureSize(text, asd.WritingDirection.Horizontal); CenterPosition = new asd.Vector2DF(size.X / 2.0f, size.Y / 2.0f); Position = new asd.Vector2DF(x, y); Text = text; }
public Arrow(asd.Vector2DF pos) : base() { //適当な画像 Texture = asd.Engine.Graphics.CreateTexture2D("arrow4.png"); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); Color = new asd.Color(255, 255, 255, 200);//透明感出したい Scale = new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, 1.25f * (float)Program.CellLarge / (float)Texture.Size.Y); Position = pos; }
public Graph(asd.Color color, int[,] lines) { for (int y = 0; y < lines.GetLength(0); y++) { for (int x = 0; x < lines.GetLength(1); x++) { AddChip(x, y, color, lines[y, x]); } } }
void Serialize() { line.Thickness = (float)2.5f * ((Dungeon)Layer.Scene).cameraN; Shape = line; Color = new asd.Color(255, 255, 0, 200); Position = new asd.Vector2DF(0, 0); sqLength = start.SqDist(end); mid = (start.pos + end.pos) / 2; }
public Graph(asd.Color color, params string[] lines) { for (int y = 0; y < lines.Length; y++) { var line = lines[y]; for (int x = 0; x < line.Length; x++) { AddChip(x, y, color, line[x]); } } }
private static IControllerButton CreateButton(int index, float x, float y) { var defaultColor = new asd.Color(255, 255, 255); var hoverColor = new asd.Color(150, 150, 150); var holdColor = new asd.Color(50, 50, 50); var size = new asd.Vector2DF(150.0f, 150.0f); var buttonArea = new asd.RectF(-size / 2.0f, size); var buttonObj = new asd.GeometryObject2D() { Shape = new asd.RectangleShape() { DrawingArea = buttonArea } , Color = defaultColor , Position = asd.Engine.WindowSize.To2DF() / 2.0f + (new asd.Vector2DF(x, y)) } ; var button = new ControllerButtonComponent <asd.GeometryObject2D>("Button"); //button.DefaultEvent += owner => { }; //button.HoverEvent += owner => { }; //button.HoldEvent += owner => { }; button.OnEnteredEvent += owner => { Console.WriteLine("Button{0}: OnEntered", index); owner.Color = hoverColor; }; button.OnPushedEvent += owner => { Console.WriteLine("Button{0}: OnPushed", index); owner.Color = holdColor; }; button.OnReleasedEvent += owner => { Console.WriteLine("Button{0}: OnReleased", index); owner.Color = hoverColor; }; button.OnExitedEvent += owner => { Console.WriteLine("Button{0}: OnExited", index); owner.Color = defaultColor; }; buttonObj.AddComponent(button, button.Name); return(button); }
public Circle(asd.Vector2DF position, asd.Vector2DF velocity, float diameter) { radius = diameter / 2; circleShape = new asd.CircleShape(); circleShape.OuterDiameter = diameter; Shape = circleShape; Position = position; Color = new asd.Color(255, 255, 255, 128); this.velocity = velocity; }
public PlayerRect() { width = 12; height = 60; rectShape = new asd.RectangleShape(); rectShape.DrawingArea = new asd.RectF(-width/2, -height/2, width, height); Shape = rectShape; Color = new asd.Color(255, 255, 255, 128); direction = new asd.Vector2DF(1, 0); direction.Degree = Angle; }
private GeneralText MoveNum; //動いた総数を表示 public Player(asd.Vector2DF pos) { IsClear = false; PreStatus = new List <byte[]>(); CurrentAxis = 0; MoveSpeed = 8; MoveCount = 0; Texture = asd.Engine.Graphics.CreateTexture2D("PlayerUp.png"); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); Scale = new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, (float)Program.CellLarge / (float)Texture.Size.Y); Color = new asd.Color(255, 255, 255, 100);//透明感出したい Position = pos; }
public PlayerRect() { width = 12; height = 60; rectShape = new asd.RectangleShape(); rectShape.DrawingArea = new asd.RectF(-width / 2, -height / 2, width, height); Shape = rectShape; Color = new asd.Color(255, 255, 255, 128); direction = new asd.Vector2DF(1, 0); direction.Degree = Angle; }
public WarpZone(asd.Vector2DF pos, asd.Vector2DF warpPos) { InstanceID = GenerateID(); WarpID = InstanceID; WarpPos = warpPos; Position = pos; Texture = asd.Engine.Graphics.CreateTexture2D("WarpZone.png"); Color = new asd.Color(255, 255, 255, 90);//透明感出したい Scale = 1.2f * new asd.Vector2DF((float)Program.CellLarge / (float)Texture.Size.X, (float)Program.CellLarge / (float)Texture.Size.Y); CenterPosition = new asd.Vector2DF(Texture.Size.X / 2, Texture.Size.Y / 2); InstanceIDText = new GeneralText(Position - Adjust * new asd.Vector2DF(Program.CellLarge, Program.CellLarge), InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(InstanceIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); WarpIDText = new GeneralText(Position + Adjust * new asd.Vector2DF(0, Program.CellLarge), "→" + InstanceID.ToString(), Program.CellLarge / 2, Black, 0, Black); AddDrawnChild(WarpIDText, asd.ChildManagementMode.RegistrationToLayer | asd.ChildManagementMode.Disposal, asd.ChildTransformingMode.Nothing, asd.ChildDrawingMode.Nothing); }
public FeverLine(GameScene gscene, Player playerRef) { //線の始点・終点・幅を定義して、形を決める。 var arc = new asd.LineShape(); arc.StartingPosition = new asd.Vector2DF(0, 0); arc.EndingPosition = new asd.Vector2DF(asd.Engine.WindowSize.X, 0); arc.Thickness = 20; Shape = arc; Color = new asd.Color(200, 220, 25, 200); scene = gscene; player = playerRef; }
public static bool Color(this asd.Tool tool, string label, ref asd.Color color) { var buf = new float[4] { color.R / 255.0f, color.G / 255.0f, color.B / 255.0f, color.A / 255.0f }; var changed = tool.ColorEdit4(label, buf); color = new asd.Color((byte)(buf[0] * 255), (byte)(buf[1] * 255), (byte)(buf[2] * 255), (byte)(buf[3] * 255)); return(changed); }
private void AddChip(int x, int y, asd.Color color, int c) { var chip = new asd.Chip2D(); chip.Texture = Resource.Font; chip.Scale = new asd.Vector2DF( Consts.CharSize.X / Consts.FontSize.X, Consts.CharSize.Y / Consts.FontSize.Y); chip.Color = color; chip.Position = new asd.Vector2DF(x * Consts.CharSize.X, y * Consts.CharSize.Y); c -= ' '; float diffX = (c % 16) * Consts.FontSize.X; float diffY = (c / 16) * Consts.FontSize.Y; chip.Src = new asd.RectF(diffX, diffY, Consts.FontSize.X, Consts.FontSize.Y); Charas.Add(new Tuple <int, int>(x, y), chip); }
internal void DrawTextAdditionally_(asd.Vector2DF pos, asd.Color color, asd.Font font, string text, asd.WritingDirection writingDirection, asd.AlphaBlendMode alphaBlend, int priority) { base.DrawTextAdditionally( pos, color, font, text, writingDirection, alphaBlend, priority); }
public Corridor(asd.Vector2DF pos, asd.Vector2DF size, float N) { Position = pos; this.size = size; rect = new asd.RectangleShape { DrawingArea = new asd.RectF(-size / 2, size) }; Shape = rect; Color = new asd.Color(50, 50, 50, 255); lu = Position - size / 2; rd = Position + size / 2; this.N = N; }
/// <summary> /// スクリプト用Color型に変換する /// </summary> /// <param name="color">asd.Color</param> /// <returns></returns> public static Color ToScriptColor(this asd.Color color) { return(new Color(color.R, color.G, color.B, color.A)); }