Changeset 7540 for code/trunk/src/modules/pickup/PickupRepresentation.h
- Timestamp:
- Oct 14, 2010, 11:20:16 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pickup/PickupRepresentation.h
r7539 r7540 42 42 #include "pickup/PickupIdentifier.h" 43 43 #include "worldentities/StaticEntity.h" 44 44 45 #include "PickupSpawner.h" 45 46 … … 52 53 /** 53 54 @brief 54 The PickupRepresentation class represents a specific pickup type (identified by its PickupIdentifier). It defines the information displayed in the GUI and how PickupSpawners that spawn the pickup type look like. 55 They are created through XML and are registered with the PickupManager. 55 The PickupRepresentation class represents a specific pickup type (identified by its @ref orxonox::PickupIdentififer "PickupIdentifier"). It defines the information displayed in the GUI (PickupInventory) and how @ref orxonox::PickupSpawner "PickupSpawners" that spawn the pickup type look like. 56 They are created through XML and are registered with the @ref orxonox::PickupManager "PickupManager". 57 58 Creating a PickupRepresentation in XML could look as follows: 59 @code 60 <PickupRepresentation 61 name = "My awesome Pickup" 62 description = "This is the most awesome Pickup ever to exist." 63 spawnerTemplate = "awesomePickupRepresentation" 64 inventoryRepresentation = "AwesomePickup" 65 > 66 <pickup> 67 <SomePickup /> 68 </pickup> 69 </PickupRepresentation> 70 @endcode 71 As you might have noticed, there is a parameter called <em>spawnerTemplate</em> and also another parameter called <em>inventoryRepresentation</em>. Let's first explain the second one, <em>inventoryRepresentation</em>. 72 - The <b>inventoryRepresentation</b> specifies the image that is displayed in the PickupInventory for the specific type of @ref orxonox::Pickupable "Pickupable". More technically, it is the name of an image located in the <code>PickupInventory.imageset</code>, which in turn is located in <code>data_extern/gui/imagesets/</code>. 73 - The <b>spawnerTemplate</b> specifies how the type of @ref orxonox::Pickupable "Pickupable" (or more precisely the @ref orxonox::PickupSpawner "PickupSpawner", that spawns that type of @ref orxonox::Pickupable "Pickupable") is displayed ingame. It is a @ref orxnox::Template "Template" defined in XML. The <em>spawnerTemplate</em> can be specified as follows (keep in mind, that the template needs to have been specified before the definition of the PickupRepresentation that uses it). 74 @code 75 <Template name="awesomePickupRepresentation"> 76 <PickupRepresentation> 77 <spawner-representation> 78 <StaticEntity> 79 <attached> 80 <!-- Here you can put all the objects which define the look of the spawner. --> 81 </attached> 82 </StaticEntity> 83 </spawner-representation> 84 </PickupRepresentation> 85 </Template> 86 @endcode 87 88 For the purpose of them working over the network, they are synchronised. 56 89 57 90 @author … … 69 102 virtual ~PickupRepresentation(); //!< Destructor. 70 103 71 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 104 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PickupRepresentation object through XML. 72 105 73 106 /** … … 152 185 StaticEntity* getDefaultSpawnerRepresentation(PickupSpawner* spawner); //!< Get the default spawnerRepresentation for a specific PickupSpawner. 153 186 154 void registerVariables(void); //!< Register some variables for synchronisation.187 void registerVariables(void); //!< Registers the variables that need to be synchronised. 155 188 156 189 std::string name_; //!< The name of the Pickupable represented by this PickupRepresentation.
Note: See TracChangeset
for help on using the changeset viewer.