LuaAPI.wiki
changeset 533 f33a741d9057
parent 519 b757c990bd5c
child 535 5cb76f048bd9
equal deleted inserted replaced
532:8b7a9c032722 533:f33a741d9057
   557 
   557 
   558 Example:
   558 Example:
   559 
   559 
   560 <code language="lua">    gear = AddGear(...)
   560 <code language="lua">    gear = AddGear(...)
   561     FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
   561     FindPlace(gear, true, 0, LAND_WIDTH) -- places the gear randomly between 0 and LAND_WIDTH</code>
   562 === <tt>!HogSay(gearUid, text, manner)</tt> ===
   562 === <tt>!HogSay(gearUid, text, manner [,vgState])</tt> ===
   563 Makes the specified gear say, think, or shout some text in a bubble.
   563 Makes the specified gear say, think, or shout some text in a comic-style speech or thought bubble. In 0.9.21 `gearUid` is _not_ limited to hedgehogs, altough the function name suggests otherwise.
   564 
   564 
   565 Example:
   565 The `manner` parameter specifies the type of the bubble and can have one of these values:
   566 
   566 
   567 <code language="lua">    HogSay(CurrentHedgehog, "I wonder what to do...", SAY_THINK) -- thought bubble with text
   567 || *Value of `manner`* || *Looks* ||
   568     HogSay(CurrentHedgehog, "I'm hungry...", SAY_SAY) -- speech bubble with text
   568 || `SAY_THINK` || Thought bubble ||
   569     HogSay(CurrentHedgehog, "I smell CAKE!", SAY_SHOUT) -- exclamatory bubble with text
   569 || `SAY_SAY` || Speech bubble ||
   570 </code>
   570 || `SAY_SHOUT` || Exclamatory bubble (denotes shouting) ||
       
   571 
       
   572 As of 0.9.21, there is a optional 4th parameter `vgState`, it defines wheather the speechbubble is drawn fully opaque or semi-transparent. The value `0` is the default value.
       
   573 
       
   574 || *Value of `vgState`* || *Effect* ||
       
   575 || `0` || If the specified gear is a hedgehog, and it’s the turn of the hedgehog’s team, the bubble is drawn fully opaque.<br>If the gear is a hedgehog, and it’s another team’s turn, the bubble is drawn translucent.<br>If the gear is not a hedgehog, the bubble is drawn fully opaque. ||
       
   576 || `1` || The bubble is drawn translucent. ||
       
   577 || `2` || The bubble is drawn fully opaque. ||
       
   578 
       
   579 Examples:
       
   580 
       
   581 <code language="lua">HogSay(CurrentHedgehog, "I wonder what to do …", SAY_THINK) -- thought bubble with text “I wonder what to do …”</code>
       
   582 <code language="lua">HogSay(CurrentHedgehog, "I'm hungry.", SAY_SAY) -- speech bubble with text “I’m hungry.”</code>
       
   583 <code language="lua">HogSay(CurrentHedgehog, "I smell CAKE!", SAY_SHOUT) -- exclamatory bubble with text “I smell CAKE!”</code>
   571 === <tt>!HogTurnLeft(gearUid, boolean)</tt> ===
   584 === <tt>!HogTurnLeft(gearUid, boolean)</tt> ===
   572 Faces the specified hog left or right.
   585 Faces the specified hog left or right.
   573 
   586 
   574 Example:
   587 Example:
   575 
   588