private static GameObject buildWall(int x, int y) { Color fillColor = Color.DimGray; RectRenderer wallRenderer = new RectRenderer() { Rect = new Rectangle(0, 0, tileSize, tileSize), DrawStyle = ShapeDrawStyles.Filled, FillColor = fillColor }; SimpleBoxCollider wallCollider = new SimpleBoxCollider() { Passive = true, Hitbox = new Rectangle(0, 0, tileSize, tileSize), Tags = { "reflective" } }; GameObject wallObj = new GameObject("Wall [" + x + "," + y + "]") { LocalPosition = new Point(x * tileSize, y * tileSize), Layer = .1f }; wallObj.AddComponent(wallRenderer); wallObj.AddComponent(wallCollider); return(wallObj); }
protected override void OnStart() { Rectangle = new Rect(); SelectedObjects = new List <GameObject>(); renderer = GetComponent <RectRenderer>() as RectRenderer; renderer.Units = Units.Viewport; renderer.Foreground = new Malison.Core.TermColor(0, 0, 255, 100); foreach (var item in Game.GetObjectsByName("Player")) { (item as Farmer).Selected = false; } }
void Start() { var color = Color.black; var width = 0.1f; var height = 0.1f; var angle = 0f; /* * if (unit is Player) { * //color = Color.green; * height = 0.3f; * //angle = 22.5f; * } */ shapeRenderer = ShapeGOFactory.InstantiateRect(new RectProperty(width: width, height: height, color: color, angle: angle, layer: -2)); }
protected override void Load() { RectRenderer rectRenderer = new RectRenderer() { BorderThickness = 10, Rect = new Rectangle(0, 0, 30, 30) }; var obj = new GameObject("TitleScreen") { Layer = 0f }; obj.AddComponent(rectRenderer); obj.AddComponent(new SimpleController()); obj.AddComponent(new RectTester()); AddObj(obj); BackgroundColor = Palette.DarkGray; Music.PlayTrack(0); Music.StereoDepth = .4f; }
protected override void Initialize() { rectRenderer = GetComponent <RectRenderer>(); }
protected void FillRect(SpriteBatch spriteBatch, Rectangle rect, Color color) { RectRenderer.Fill(spriteBatch, rect, color); }
protected void FillRect(SpriteBatch spriteBatch, int x, int y, int width, int height, Color color) { RectRenderer.Fill(spriteBatch, new Rectangle(x, y, width, height), color); }