public WTTableCell(string name, float horizontalPadding, float verticalPadding, float width, Color backgroundColor, TableCellType type) : base(name) { this.tableCellType = type; horizontalPadding_ = horizontalPadding; verticalPadding_ = verticalPadding; width_ = width; if (backgroundColor.a > 0) { backgroundSpriteComponent = new WTSpriteComponent("backgroundSpriteComponent", "Futile_White"); backgroundSpriteComponent.sprite.color = backgroundColor; backgroundSpriteComponent.sprite.width = width_; backgroundSpriteComponent.sprite.anchorX = 0; backgroundSpriteComponent.sprite.anchorY = 0; backgroundSpriteComponent.sprite.y = 1; AddComponent(backgroundSpriteComponent); } bottomLineSpriteComponent = new WTSpriteComponent("bottomLineSpriteComponent", "Futile_White"); bottomLineSpriteComponent.sprite.width = width; bottomLineSpriteComponent.sprite.height = 1f; bottomLineSpriteComponent.sprite.color = Color.black; bottomLineSpriteComponent.sprite.alpha = 0.2f; bottomLineSpriteComponent.sprite.anchorX = 0; //bottomLineSpriteComponent.sprite.y = 1f; AddComponent(bottomLineSpriteComponent); }
public HexSliceEntity(string name, Color backgroundColor) : base(name) { HexBackgroundSlice hbs = new HexBackgroundSlice(60f, 700f); hbs.rotation = -90f; hbs.color = backgroundColor; backgroundSliceComponent = new WTSpriteComponent("backgroundSliceComponent", hbs); AddComponent(backgroundSliceComponent); }
public void AddNewCrossbar(float height) { HexCrossBar hcb = new HexCrossBar(height); hcb.y = 700f; hcb.distanceFromBackgroundSliceOrigin = 700f; WTSpriteComponent crossBarComponent = new WTSpriteComponent(string.Format("crossBarComponent{0}", crossBarNum), hcb); crossBarNum++; obstacleComponents.Add(crossBarComponent); AddComponent(crossBarComponent); }
public HexCenterHexagon(string name) : base(name) { WTSpriteComponent innerHex = new WTSpriteComponent("innerHex", "innerHexagon"); innerHex.sprite.color = new Color(0.3f, 0.3f, 0.3f, 1.0f); AddComponent(innerHex); WTSpriteComponent outerHex = new WTSpriteComponent("outerHex", "hexagon"); outerHex.sprite.color = new Color(1.0f, 0.8f, 0.2f, 1.0f); AddComponent(outerHex); }
public HexTriangle(string name) : base(name) { shadowComponent = new WTSpriteComponent("shadowComponent", "triangle"); shadowComponent.sprite.color = new Color(0.12f, 0.12f, 0.12f, 1.0f); shadowComponent.sprite.scale = 1.2f; shadowComponent.sprite.alpha = 0.5f; AddComponent(shadowComponent); mainSpriteComponent = new WTSpriteComponent("mainSpriteComponent", "triangle"); mainSpriteComponent.sprite.color = new Color(1.0f, 0.2f, 0.8f, 1.0f); AddComponent(mainSpriteComponent); }
public void AddRightSprite(string imageName, float spriteScale) { WTSpriteComponent sc = new WTSpriteComponent("rightSpriteComponent", imageName); sc.sprite.scale = spriteScale; sc.sprite.x = width_ - sc.sprite.width / 2f - horizontalPadding_; rightSpriteComponent = sc; AddComponent(sc); this.height = Mathf.Max(height_, sc.sprite.localRect.height + verticalPadding_ * 2); sc.sprite.y = height_ / 2f; }