Skip to content

Commit

Permalink
fixed show bug
Browse files Browse the repository at this point in the history
  • Loading branch information
autismuk committed Jul 3, 2014
1 parent f22e13c commit 6ac54a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ <h2>getFontInstance(fontName)</h2>
<hr><h1>BitmapString</h1>
<p><h3>Extends Base</h3></p>
<p></p>
<p>Methods : <a href="#BitmapString_(constructor)"/>(constructor)</a>,<a href="#BitmapString_animate"/>animate</a>,<a href="#BitmapString_clear"/>clear</a>,<a href="#BitmapString_destroy"/>destroy</a>,<a href="#BitmapString_getImageLocation"/>getImageLocation</a>,<a href="#BitmapString_getView"/>getView</a>,<a href="#BitmapString_moveTo"/>moveTo</a>,<a href="#BitmapString_removeSelf"/>removeSelf</a>,<a href="#BitmapString_setAnchor"/>setAnchor</a>,<a href="#BitmapString_setAnimationRate"/>setAnimationRate</a>,<a href="#BitmapString_setDirection"/>setDirection</a>,<a href="#BitmapString_setEncoding"/>setEncoding</a>,<a href="#BitmapString_setFont"/>setFont</a>,<a href="#BitmapString_setFontSize"/>setFontSize</a>,<a href="#BitmapString_setImageLocation"/>setImageLocation</a>,<a href="#BitmapString_setJustification"/>setJustification</a>,<a href="#BitmapString_setModifier"/>setModifier</a>,<a href="#BitmapString_setScale"/>setScale</a>,<a href="#BitmapString_setSpacing"/>setSpacing</a>,<a href="#BitmapString_setText"/>setText</a>,<a href="#BitmapString_setTintBrackets"/>setTintBrackets</a>,<a href="#BitmapString_setTintColor"/>setTintColor</a>,<a href="#BitmapString_setVerticalSpacing"/>setVerticalSpacing</a>,<a href="#BitmapString_show"/>show</a>,<a href="#BitmapString_stop"/>stop</a></p><hr><a name="BitmapString_(constructor)"></a>
<p>Methods : <a href="#BitmapString_(constructor)"/>(constructor)</a>,<a href="#BitmapString_animate"/>animate</a>,<a href="#BitmapString_clear"/>clear</a>,<a href="#BitmapString_destroy"/>destroy</a>,<a href="#BitmapString_getImageLocation"/>getImageLocation</a>,<a href="#BitmapString_getView"/>getView</a>,<a href="#BitmapString_moveTo"/>moveTo</a>,<a href="#BitmapString_new"/>new</a>,<a href="#BitmapString_removeSelf"/>removeSelf</a>,<a href="#BitmapString_setAnchor"/>setAnchor</a>,<a href="#BitmapString_setAnimationRate"/>setAnimationRate</a>,<a href="#BitmapString_setDirection"/>setDirection</a>,<a href="#BitmapString_setEncoding"/>setEncoding</a>,<a href="#BitmapString_setFont"/>setFont</a>,<a href="#BitmapString_setFontSize"/>setFontSize</a>,<a href="#BitmapString_setImageLocation"/>setImageLocation</a>,<a href="#BitmapString_setJustification"/>setJustification</a>,<a href="#BitmapString_setModifier"/>setModifier</a>,<a href="#BitmapString_setScale"/>setScale</a>,<a href="#BitmapString_setSpacing"/>setSpacing</a>,<a href="#BitmapString_setText"/>setText</a>,<a href="#BitmapString_setTintBrackets"/>setTintBrackets</a>,<a href="#BitmapString_setTintColor"/>setTintColor</a>,<a href="#BitmapString_setVerticalSpacing"/>setVerticalSpacing</a>,<a href="#BitmapString_show"/>show</a>,<a href="#BitmapString_stop"/>stop</a></p><hr><a name="BitmapString_(constructor)"></a>
<h2>(constructor)(fontName,fontSize)</h2>
<table>
<tr><td>fontName</td><td>string</td><td>Name of font, corresponds to .fnt file.</td></tr>
<tr><td>fontSize</td><td>number</td><td>Height of font in pixels, default is current size if ommitted, DEFAULT_SIZE is actual physical font size on PNG.</td></tr>
</table>
<p>We have a replacement constructor, which decorates a Corona Group with the BitmapString's methods. Note that you cannot therefore subclass BitmapString as normal, because it is a mixin. Constructor initialisation. Sets the font name and size.</p>
<p>Constructor initialisation. Sets the font name and size.</p>
<a name="BitmapString_anchorMove"></a>
<a name="BitmapString_animate"></a>
<h2>animate(speedScalar)</h2>
Expand Down Expand Up @@ -99,6 +99,12 @@ <h2>moveTo(x,y)</h2>
<tr><td>return</td><td>BitmapString</td><td>allows chaining.</td></tr>
</table>
<p>Move the view group - i.e. the font. Included for consistency, you can just assign to x,y</p>
<a name="BitmapString_new"></a>
<h2>new(...)</h2>
<table>
<tr><td>...</td><td></td><td></td></tr>
</table>
<p>We have a replacement constructor, which decorates a Corona Group with the BitmapString's methods. Note that you cannot therefore subclass BitmapString as normal, because it is a mixin.</p>
<a name="BitmapString_reformatLine"></a>
<a name="BitmapString_reformatText"></a>
<a name="BitmapString_removeSelf"></a>
Expand Down
1 change: 1 addition & 0 deletions main_new.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ bms:setText("QM")
bms:moveTo(0,0) -- postion it
bms:setAnchor(0,0)
bms:setJustification(bms.Justify.LEFT) -- left justify
bms:show()
--bms.rotation = 10 -- rotate
--bms:setFont("font2") -- change font
--bms:setVerticalSpacing(1.2) -- change vertical spacing.
Expand Down
5 changes: 3 additions & 2 deletions system/fontmanager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,9 @@ BitmapString.remove = BitmapString.removeSelf -- synonym remove for

function BitmapString:show()
self.internalXAnchor,self.internalYAnchor = self.anchorX or 0.5,self.anchorY or 0.5 -- get anchor X, anchor Y
self.currText = self.text .. "!" -- this means the change check will fail :)
self:setText(self.text) -- set the text
local text = self.currText -- get current text
self.currText = text .. "!" -- this means the change check will fail :)
self:setText(text) -- set the text back so it reformats.
return self
end

Expand Down

0 comments on commit 6ac54a7

Please sign in to comment.