/// <summary> /// Display a tooltip with the appropiate content. /// </summary> protected virtual void OnTooltip(bool show) { if (!string.IsNullOrEmpty(item.content)) { if (show) { UICustomTooltip.Show(item.content); } else { UICustomTooltip.Hide(); } } }
private void InitializeMap(int cityMap) { CityRenderer = new Terrain(GameFacade.GraphicsDevice); //The Terrain class implements the ThreeDAbstract interface so that it can be treated as a scene but manage its own drawing and updates. CityRenderer.m_GraphicsDevice = GameFacade.GraphicsDevice; CityRenderer.Initialize(cityMap); CityRenderer.LoadContent(GameFacade.GraphicsDevice); CityRenderer.RegenData = true; CityRenderer.SetTimeOfDay(0.5); GameFacade.Scenes.Add(CityRenderer); CityTooltip = new UICustomTooltip(); Add(CityTooltip); CityTooltipHitArea = new UICustomTooltipContainer(CityTooltip); CityTooltipHitArea.SetSize(ScreenWidth, ScreenHeight); AddAt(0, CityTooltipHitArea); }
void OnDestroy() { mInstance = null; }
void Awake() { mInstance = this; }