protected override void OnStart() { scene = new Scene(); layer = new Layer2D(); layer2 = new Layer2D(); textureObject = new TextureObject2D { Texture = Engine.Graphics.CreateTexture2D(CloudTexturePath) }; textObject = new TextObject2D { Font = Engine.Graphics.CreateFont("Data/Font/meiryoTest.aff") }; geometoryObject = new GeometryObject2D { Shape = new RectangleShape() { DrawingArea = new RectF(0, 0, 100, 100) } }; Engine.ChangeScene(scene); scene.AddLayer(layer); scene.AddLayer(layer2); layer.AddObject(textureObject); layer.AddObject(textObject); layer.AddObject(geometoryObject); var tex = textureObject.Texture; var font = textObject.Font; var col = geometoryObject.Color; }
private void PlaceVectors(NumberVector start) { //float angleSpan = 137.507f; float angleSpan = 360 / 72.0f; for (int i = 2; i <= 72; i++) { var vector = NumberVector.CreateForNumber(i); var distance = (vector - start).GetLength(); var position = new Vector2DF(1, 1); position.Degree = angleSpan * i; position.Length = distance * DistanceUnit; position += new Vector2DF(320, 320); var obj = new TextObject2D() { Text = i.ToString(), Font = font, Position = position, Color = vector.IsPrime() ? Helper.AccentColor1 : Helper.PlaneColor, DrawingPriority = 2, }; var size = font.CalcTextureSize(i.ToString(), WritingDirection.Horizontal); obj.CenterPosition = size.To2DF() / 2; layer.AddObject(obj); } }
protected override void OnStart() { textObject = new TextObject2D() { Font = Engine.Graphics.CreateDynamicFont("", 24, new Color(255, 255, 255), 0, new Color()), Position = new Vector2DF(10, 10), }; Engine.AddObject2D(textObject); }
protected override void OnRegistered() { //単一のレイヤ Layer2D layer = new Layer2D(); AddLayer(layer); //テキスト表示 TextObject2D text = new TextObject2D(); text.Font = Engine.Graphics.CreateFont("Resource/test.aff"); text.Text = "Zキーでスタート"; text.Position = new Vector2DF(10, 100); layer.AddObject(text); }
protected override void OnStart() { var scene = new Scene(); var layer = new Layer2D(); textObjects = new List <TextObject2D>(); for (int i = 0; i < 8; ++i) { var text = new TextObject2D(); text.Font = Engine.Graphics.CreateDynamicFont("", 32, new Color(255, 0, 0, 255), 0, new Color(0, 0, 0, 0)); text.Position = new Vector2DF(40, 40 + 50 * i); textObjects.Add(text); layer.AddObject(text); } scene.AddLayer(layer); asd.Engine.ChangeScene(scene); }
protected override void OnStart() { var font = Engine.Graphics.CreateFont("Data/Font/meiryoTest.aff"); var texture = Engine.Graphics.CreateTexture2D(CloudTexturePath); var parent = new TextObject2D() { Font = font, Text = "Meiryo\nTest", Position = new Vector2DF(20, 20), Color = new Color(255, 128, 128, 255), DrawingPriority = 2, }; var child1 = new TextObject2D() { Font = font, Text = "Meiryo\nTest", Position = new Vector2DF(0, 20), Color = new Color(128, 128, 255, 255), DrawingPriority = 1, }; var child2 = new TextObject2D() { Font = font, Text = "Meiryo\nTest", Position = new Vector2DF(20, 0), Color = new Color(128, 128, 255, 255), DrawingPriority = 1, }; parent.AddDrawnChild(child1, ChildManagementMode.Nothing, ChildTransformingMode.All, ChildDrawingMode.Color | ChildDrawingMode.DrawingPriority); parent.AddDrawnChild(child2, ChildManagementMode.Nothing, ChildTransformingMode.All, ChildDrawingMode.Nothing); Engine.AddObject2D(parent); Engine.AddObject2D(child1); Engine.AddObject2D(child2); }
public SampleItem(ISample sample, Font font) { var sampleName = sample.GetType().Name; Sample = sample; Texture = Engine.Graphics.CreateTexture2D("Data/Browser/" + sampleName + ".png"); if (Texture == null) { Texture = Engine.Graphics.CreateTexture2D("Data/Browser/Default.png"); } Scale = Size / Texture.Size.To2DF(); var text = sampleName; if (text.Length > TitleMaxLength) { text = "…" + text.Substring(text.Length - TitleMaxLength); } Title = new TextObject2D() { Text = text, Font = font, Position = new Vector2DF(0, 115), DrawingPriority = 1, }; AddChild(Title, ChildMode.Position); frame = new TextureObject2D() { Texture = Engine.Graphics.CreateTexture2D("Data/Browser/Frame.png"), Position = new Vector2DF(-3, -3), }; AddChild(frame, ChildMode.Position); }
public ProfileCardView(Model.Objects.BattleToken model, Font headerFont, Font planeFont) { void AddChild(Object2D obj) { base.AddChild(obj, ChildManagementMode.Disposal | ChildManagementMode.RegistrationToLayer, ChildTransformingMode.All); } this.Model = model; var illust = new TextureObject2D() { Texture = Engine.Graphics.CreateTexture2D(model.Property.ProfileImage), TextureFilterType = TextureFilterType.Linear, }; var overlay = new TextureObject2D() { Texture = Engine.Graphics.CreateTexture2D("Textures/ProfileOverlay.png"), DrawingPriority = 1, TextureFilterType = TextureFilterType.Linear, }; var name = new TextObject2D() { Font = headerFont, Position = new Vector2DF(overlay.Texture.Size.X / 2, 40), Text = model.Property.Name, Color = new Color(0, 0, 0), DrawingPriority = 2, }; name.SetCenterPosition(Altseed.Reactive.CenterPosition.CenterCenter); int skillIndex = 0; foreach (var skill in model.Skills) { var header = new TextObject2D() { Font = headerFont, Scale = new Vector2DF(1, 1) / 1.5f, Color = new Color(0, 0, 0), Position = new Vector2DF(25, 359 + skillIndex * 88), Text = skill.Property.Name, DrawingPriority = 2, }; var body = new TextObject2D() { Font = planeFont, Scale = new Vector2DF(1, 1) * 3 / 4, Color = new Color(0, 0, 0), Position = new Vector2DF(51, 389 + skillIndex * 88), Text = skill.Property.Description, DrawingPriority = 2, }; AddChild(header); AddChild(body); } AddChild(illust); AddChild(overlay); AddChild(name); size = overlay.Texture.Size; }