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

fix for testbed projects and update CCActionManager #419

Merged
merged 1 commit into from
Nov 1, 2024
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
2 changes: 1 addition & 1 deletion Tests/cocos2d-mono.Tests/ActionManagerTest/RemoveTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override void OnEnter()
public void stopAction()
{
CCNode pSprite = GetChildByTag(kTagGrossini);
pSprite.StopActionByTag((int)KTag.kTagSequence);
pSprite.StopAction((int)KTag.kTagSequence);
}
}
}
12 changes: 6 additions & 6 deletions Tests/cocos2d-mono.Tests/ActionsEaseTest/EaseActionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ public override String title()
public void testStopAction(float dt)
{
Unschedule(testStopAction);
m_kathia.StopActionByTag(1);
m_tamara.StopActionByTag(1);
m_grossini.StopActionByTag(1);
m_kathia.StopAction(1);
m_tamara.StopAction(1);
m_grossini.StopAction(1);
}
}

Expand Down Expand Up @@ -546,9 +546,9 @@ public override void OnEnter()

public void altertime(float dt)
{
var action1 = (CCSpeed) (m_grossini.GetActionByTag(EaseTest.kTagAction1));
var action2 = (CCSpeed) (m_tamara.GetActionByTag(EaseTest.kTagAction1));
var action3 = (CCSpeed) (m_kathia.GetActionByTag(EaseTest.kTagAction1));
var action1 = (CCSpeed) (m_grossini.GetAction(EaseTest.kTagAction1));
var action2 = (CCSpeed) (m_tamara.GetAction(EaseTest.kTagAction1));
var action3 = (CCSpeed) (m_kathia.GetAction(EaseTest.kTagAction1));

action1.Speed = CCRandom.Float_0_1() * 2;
action2.Speed = CCRandom.Float_0_1() * 2;
Expand Down
2 changes: 1 addition & 1 deletion Tests/cocos2d-mono.Tests/BugsTest/Bug-458/Bug-458.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override bool Init()
CCLayerColor layer2 = new CCLayerColor(new CCColor4B(255, 0, 0, 255), 100, 100);
CCMenuItemSprite sprite2 = new CCMenuItemSprite(layer, layer2, this, selectAnswer);
CCMenu menu = new CCMenu(sprite, sprite2, null);
menu.AlignItemsVerticallyWithPadding(100);
menu.AlignItemsVertically(100);
menu.Position = new CCPoint(size.Width / 2, size.Height / 2);

// add the label as a child to this Layer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public BitmapFontMultiLineAlignment()
CCMenuItemFont center = new CCMenuItemFont("Center", alignmentChanged);
CCMenuItemFont right = new CCMenuItemFont("Right", alignmentChanged);
CCMenu alignmentMenu = new CCMenu(left, center, right);
alignmentMenu.AlignItemsHorizontallyWithPadding(alignmentItemPadding);
alignmentMenu.AlignItemsHorizontally(alignmentItemPadding);

center.Color = CCTypes.CCRed;
m_pLastAlignmentItem = center;
Expand Down
4 changes: 2 additions & 2 deletions Tests/cocos2d-mono.Tests/LabelTest/LabelTTFTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LabelTTFTest()
new CCMenuItemFont("Center", setAlignmentCenter),
new CCMenuItemFont("Right", setAlignmentRight)
);
menu.AlignItemsVerticallyWithPadding(4);
menu.AlignItemsVertically(4);
menu.Position = new CCPoint(50, s.Height / 2 - 20);
AddChild(menu);

Expand All @@ -35,7 +35,7 @@ public LabelTTFTest()
new CCMenuItemFont("Middle", setAlignmentMiddle),
new CCMenuItemFont("Bottom", setAlignmentBottom)
);
menu.AlignItemsVerticallyWithPadding(4);
menu.AlignItemsVertically(4);
menu.Position = new CCPoint(s.Width - 50, s.Height / 2 - 20);
AddChild(menu);

Expand Down
4 changes: 2 additions & 2 deletions Tests/cocos2d-mono.Tests/MenuTest/MenuLayer2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected void alignMenusH()
else
{
// TIP: but padding is configurable
menu.AlignItemsHorizontallyWithPadding(40);
menu.AlignItemsHorizontally(40);
CCPoint p = menu.Position;
menu.Position = new CCPoint(p.X - 0, p.Y - 30);
}
Expand All @@ -82,7 +82,7 @@ protected void alignMenusV()
else
{
// TIP: but padding is configurable
menu.AlignItemsVerticallyWithPadding(40);
menu.AlignItemsVertically(40);
CCPoint p = menu.Position;
menu.Position = new CCPoint(p.X - 100, p.Y);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/cocos2d-mono.Tests/MenuTest/MenuLayerPriorityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public MenuLayerPriorityTest()
m_pMenu1.AddChild(item1);
m_pMenu1.AddChild(item2);

m_pMenu1.AlignItemsVerticallyWithPadding(2);
m_pMenu1.AlignItemsVertically(2);

AddChild(m_pMenu1);

Expand Down
2 changes: 1 addition & 1 deletion Tests/cocos2d-mono.Tests/SceneTest/SceneTestLayer1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override void OnEnter()
CCLog.Log("SceneTestLayer1#onEnter");
base.OnEnter();
_PopMenuItem.Visible = CCDirector.SharedDirector.CanPopScene;
_TheMenu.AlignItemsVerticallyWithPadding(12f);
_TheMenu.AlignItemsVertically(12f);
}

public override void OnEnterTransitionDidFinish()
Expand Down
2 changes: 1 addition & 1 deletion Tests/cocos2d-mono.Tests/SceneTest/SceneTestLayer2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override void OnEnter()
CCLog.Log("SceneTestLayer2#onEnter");
base.OnEnter();
_PopMenuItem.Visible = CCDirector.SharedDirector.CanPopScene;
_TheMenu.AlignItemsVerticallyWithPadding(12f);
_TheMenu.AlignItemsVertically(12f);
}

public void onReplaceScene(object pSender)
Expand Down
6 changes: 3 additions & 3 deletions cocos2d/actions/CCActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public void RemoveActionByTag(int tag, CCNode target)
}
}

public CCAction GetActionByTag(int tag, CCNode target)
public CCAction GetAction(int tag, CCNode target)
{
Debug.Assert(tag != CCAction.kInvalidTag);

Expand All @@ -317,12 +317,12 @@ public CCAction GetActionByTag(int tag, CCNode target)
return action;
}
}
CCLog.Log("cocos2d : getActionByTag: Tag " + tag + " not found");
CCLog.Log("cocos2d : GetAction: Tag " + tag + " not found");
}
}
else
{
CCLog.Log("cocos2d : getActionByTag: Target not found");
CCLog.Log("cocos2d : GetAction: Target not found");
}
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion cocos2d/base_nodes/CCNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ public void StopAction(int tag)
public CCAction GetAction(int tag)
{
Debug.Assert(tag != (int) CCNodeTag.Invalid, "Invalid tag");
return m_pActionManager.GetActionByTag(tag, this);
return m_pActionManager.GetAction(tag, this);
}

public int NumberOfRunningActions()
Expand Down
Loading