HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Minimap unable to have a parent?  (Read 1322 times)

JChallenger

  • Developer
  • *
  • Posts: 2
    • View Profile
Minimap unable to have a parent?
« on: Sep 08, 13, 10:07:42 AM »

I have been trying to get the minimap to work within another GUIPanel. So far, nothing seems to work. I have created my own TSMS_Minimap guicontrol class, and it inherits from the clean engine _minimap. I have created a prototype of this type, which also inherits from _minimap and is of my TSMS_minimap class. However, once the map is created, the redefined HE_onRenderMinimap() method in TSMS_minimap is never reached. I am working with the following code:

(In the GUIPanel class methods for my custom gui panel of type TSMS_guiDebugWindow currently)
Code: [Select]
minimap as NodeRef of Class _minimap = FindGUIControlByName(me, "_masterLayer.Minimap")
  if minimap != None
    DestroyNode(minimap)
  .
  minimap = createNodeFromPrototype("TSMS_PlayerMinimap")
  minimap.build = true
  minimap.name = "minimap"
  minimap._setMinimapDefaultZoom()
  minimap.parent = me

The last line does two things:
without it, the map is placed in the top right corner of the window, and works correctly using my HE_onRenderMinimap() function.
without it, the map is placed in the top right corner of my custom GUIPanel, but does not function correctly (HE_onRenderMinimap() is never called)

It seems the only problem is setting the parent here. Any tips?
« Last Edit: Sep 08, 13, 10:12:47 AM by JChallenger »
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1156
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: Minimap unable to have a parent?
« Reply #1 on: Sep 08, 13, 12:57:31 PM »

I have not been able to set any kind of parent for the minimap either. I was able to make a work around for it though. You can set a panel inside the main panel for the minimap, and add stuff in there. Another thing I was not able to do was set the minimap in a layer, so that it could be turned on and off with the rest. Here an actual link to the minimap to turn it on/off is needed when the rest of the GUIs turn off with alt-G.

Here is the work around I used https://community.heroengine.com/forums/index.php/topic,4154.0.html
Logged

JChallenger

  • Developer
  • *
  • Posts: 2
    • View Profile
Re: Minimap unable to have a parent?
« Reply #2 on: Sep 08, 13, 06:41:23 PM »

Ive seen your post, I was just hoping to avoid re-creating my GUIPanel as a Minimap.
Its not the most favourable solution, but it sounds like the only one i Have right now.
Logged