This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/mono/CocosSharp into text…
…field
- Loading branch information
Showing
67 changed files
with
772 additions
and
110 deletions.
There are no files selected for viewing
Submodule MonoGame
updated
from 0f759d to 25ca7c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
tests/tests/classes/tests/LabelTestNew/LabelFSTextureView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
using System; | ||
using CocosSharp; | ||
|
||
namespace tests | ||
{ | ||
public class LabelSFTextureView : AtlasDemoNew | ||
{ | ||
CCNode spriteFontNode; | ||
|
||
public LabelSFTextureView() | ||
{ | ||
Color = new CCColor3B(128, 128, 128); | ||
Opacity = 255; | ||
|
||
|
||
} | ||
|
||
public override void OnEnter () | ||
{ | ||
base.OnEnter (); | ||
|
||
var origin = Layer.VisibleBoundsWorldspace.Size; | ||
|
||
var label1 = new CCLabel(string.Empty, "debuguncompressed", 0, CCLabelFormat.SpriteFont); | ||
|
||
var texture = label1.TextureAtlas != null ? label1.TextureAtlas.Texture : null; | ||
|
||
if (texture != null) { | ||
spriteFontNode = new CCSprite (texture); | ||
spriteFontNode.Scale = 2; | ||
} | ||
else | ||
{ | ||
spriteFontNode = new CCLabel("Texture can not be loaded", "arial", 24, CCLabelFormat.SpriteFont); | ||
} | ||
//spriteFontNode.Color = CCColor3B.Magenta; | ||
spriteFontNode.Position = origin.Center; | ||
|
||
|
||
AddChild (spriteFontNode); | ||
|
||
var itemUncompressed = new CCMenuItemLabel(new CCLabel("Uncompressed", "fonts/arial", 24, CCLabelFormat.SpriteFont)); | ||
var itemCompressed = new CCMenuItemLabel(new CCLabel("Compressed", "fonts/arial", 24, CCLabelFormat.SpriteFont)); | ||
itemUncompressed.AnchorPoint = CCPoint.AnchorMiddleLeft; | ||
itemCompressed.AnchorPoint = CCPoint.AnchorMiddleLeft; | ||
var mi1 = new CCMenuItemToggle(OnToggle, itemUncompressed, itemCompressed); | ||
var menu = new CCMenu(mi1); | ||
|
||
AddChild(menu); | ||
menu.Position = VisibleBoundsWorldspace.Left(); | ||
} | ||
|
||
void OnToggle(object sender) | ||
{ | ||
var toggle = sender as CCMenuItemToggle; | ||
if (toggle == null) | ||
return; | ||
|
||
var origin = Layer.VisibleBoundsWorldspace.Size; | ||
spriteFontNode.RemoveFromParent (true); | ||
|
||
switch(toggle.SelectedIndex) | ||
{ | ||
case 0: | ||
var label1 = new CCLabel (string.Empty, "debuguncompressed", 0, CCLabelFormat.SpriteFont); | ||
|
||
var texture = label1.TextureAtlas != null ? label1.TextureAtlas.Texture : null; | ||
|
||
if (texture != null) { | ||
spriteFontNode.RemoveFromParent (true); | ||
spriteFontNode = new CCSprite (texture); | ||
spriteFontNode.Scale = 2; | ||
} else { | ||
spriteFontNode = new CCLabel ("Texture can not be loaded", "arial", 24, CCLabelFormat.SpriteFont); | ||
} | ||
break; | ||
case 1: | ||
label1 = new CCLabel (string.Empty, "debugcompressed", 0, CCLabelFormat.SpriteFont); | ||
|
||
texture = label1.TextureAtlas != null ? label1.TextureAtlas.Texture : null; | ||
|
||
if (texture != null) { | ||
spriteFontNode.RemoveFromParent (true); | ||
spriteFontNode = new CCSprite (texture); | ||
spriteFontNode.Scale = 2; | ||
} else { | ||
spriteFontNode = new CCLabel ("Texture can not be loaded", "arial", 24, CCLabelFormat.SpriteFont); | ||
} | ||
break; | ||
|
||
} | ||
|
||
AddChild (spriteFontNode); | ||
//spriteFontNode.Color = CCColor3B.Magenta; | ||
spriteFontNode.Position = origin.Center; | ||
|
||
|
||
} | ||
|
||
public override string Title | ||
{ | ||
get { | ||
return "SpriteFont TextureAtlas"; | ||
} | ||
} | ||
|
||
public override string Subtitle | ||
{ | ||
get { | ||
return string.Empty; | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.