//depending on available stage types, maybe this function should infer stagetype from game context? public static Stage CreateStage(string stageName, StageType stageType, Dimension stageSize = null) { Stage newStage; if (stageSize != null) { newStage = new Stage(stageName, stageType, stageSize); } else { newStage = new Stage(stageName, stageType); } //if there is a main view with no stage, make this the attached stage if (View.GetMainView() != null && View.GetMainView().GetAttachedStage() == null) { View.GetMainView().AttachStage(newStage); } gameStages.Add(newStage); return newStage; }
public void SetSize(Dimension newSize) { if (newSize.width != size.width && newSize.height != size.height) { this.size = newSize; this.SetNeedsUpdate(); } }