Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes #15

Merged
merged 1 commit into from
Aug 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Test Suite/src/org/flixel/plugin/photonstorm/FlxBitmapFont.as
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ package org.flixel.plugin.photonstorm
/**
* Adds horizontal spacing between each character of the font, in pixels. Default is 0.
*/
public var customSpacingX:uint = 0;
public var customSpacingX:Number = 0;

/**
* Adds vertical spacing between each line of multi-line text, set in pixels. Default is 0.
Expand Down Expand Up @@ -243,7 +243,7 @@ package org.flixel.plugin.photonstorm
* @param lineAlignment Align each line of multi-line text. Set to FlxBitmapFont.ALIGN_LEFT (default), FlxBitmapFont.ALIGN_RIGHT or FlxBitmapFont.ALIGN_CENTER.
* @param allowLowerCase Lots of bitmap font sets only include upper-case characters, if yours needs to support lower case then set this to true.
*/
public function setText(content:String, multiLines:Boolean = false, characterSpacing:uint = 0, lineSpacing:uint = 0, lineAlignment:String = "left", allowLowerCase:Boolean = false):void
public function setText(content:String, multiLines:Boolean = false, characterSpacing:Number = 0, lineSpacing:uint = 0, lineAlignment:String = "left", allowLowerCase:Boolean = false):void
{
customSpacingX = characterSpacing;
customSpacingY = lineSpacing;
Expand Down Expand Up @@ -284,9 +284,12 @@ package org.flixel.plugin.photonstorm
{
temp = new BitmapData(fixedWidth, (lines.length * (characterHeight + customSpacingY)) - customSpacingY, true, 0xf);
}
else
else if(customSpacingX>0)
{
temp = new BitmapData(getLongestLine() * (characterWidth + customSpacingX), (lines.length * (characterHeight + customSpacingY)) - customSpacingY, true, 0xf);
}else
{
temp = new BitmapData(getLongestLine() * (characterWidth), (lines.length * (characterHeight + customSpacingY)) - customSpacingY, true, 0xf);
}

// Loop through each line of text
Expand Down Expand Up @@ -326,10 +329,14 @@ package org.flixel.plugin.photonstorm
{
temp = new BitmapData(fixedWidth, characterHeight, true, 0xf);
}
else
else if (customSpacingX>0)
{
temp = new BitmapData(_text.length * (characterWidth + customSpacingX), characterHeight, true, 0xf);
}
else
{
temp = new BitmapData(_text.length * (characterWidth), characterHeight, true, 0xf);
}

switch (align)
{
Expand Down Expand Up @@ -420,7 +427,7 @@ package org.flixel.plugin.photonstorm
// If the character doesn't exist in the font then we don't want a blank space, we just want to skip it
if (grabData[line.charCodeAt(c)] is Rectangle)
{
output.copyPixels(fontSet, grabData[line.charCodeAt(c)], new Point(x, y));
output.copyPixels(fontSet, grabData[line.charCodeAt(c)], new Point(x, y),null,null,true);

x += characterWidth + customSpacingX;

Expand Down
4 changes: 2 additions & 2 deletions Test Suite/src/org/flixel/plugin/photonstorm/FlxButtonPlus.as
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ package org.flixel.plugin.photonstorm
*/
public function loadGraphic(normal:FlxSprite, highlight:FlxSprite):void
{
buttonNormal.pixels = normal.pixels;
buttonHighlight.pixels = highlight.pixels;
buttonNormal.pixels = normal.framePixels;
buttonHighlight.pixels = highlight.framePixels;

width = buttonNormal.width;
height = buttonNormal.height;
Expand Down
Binary file modified photonstorm.zip
Binary file not shown.