Compare commits
21 Commits
d0000d2fb9
...
dd69f0a65b
| Author | SHA1 | Date |
|---|---|---|
|
|
dd69f0a65b | |
|
|
ebd130349a | |
|
|
622fe5330d | |
|
|
a397f5198b | |
|
|
0577e6bb66 | |
|
|
46de44df96 | |
|
|
1a862df685 | |
|
|
eca5da2ff9 | |
|
|
fc62731bcd | |
|
|
d8faa49866 | |
|
|
230ddba3f6 | |
|
|
3d8c996f6b | |
|
|
7d5a49862c | |
|
|
eeaeff06ce | |
|
|
cd4e30774c | |
|
|
254d6856c2 | |
|
|
5cacad707e | |
|
|
f430d6af41 | |
|
|
fc18097b7a | |
|
|
1e45bf6958 | |
|
|
2dd1bb90b9 |
BIN
Yosin_Engine.exe
BIN
Yosin_Engine.exe
Binary file not shown.
|
|
@ -6,16 +6,16 @@
|
||||||
*/
|
*/
|
||||||
class Layer extends Actor {
|
class Layer extends Actor {
|
||||||
|
|
||||||
constructor(...) {
|
// constructor(...) {
|
||||||
local C_Object;
|
// local C_Object;
|
||||||
if (vargv.len() == 0) {
|
// if (vargv.len() == 0) {
|
||||||
C_Object = LayerActor_Create();
|
// C_Object = LayerActor_Create();
|
||||||
base.constructor(C_Object);
|
// base.constructor(C_Object);
|
||||||
} else {
|
// } else {
|
||||||
C_Object = vargv[0];
|
// C_Object = vargv[0];
|
||||||
base.constructor(C_Object, true);
|
// base.constructor(C_Object, true);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//设置图层裁剪区域
|
//设置图层裁剪区域
|
||||||
function SetClipRect(x, y, w, h) {
|
function SetClipRect(x, y, w, h) {
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,21 @@ function print(Object) {
|
||||||
/*
|
/*
|
||||||
* @函数作用: 深拷贝Table
|
* @函数作用: 深拷贝Table
|
||||||
*/
|
*/
|
||||||
|
// function sq_DeepCopy(original) {
|
||||||
|
// local Ret = Json.Encode(original);
|
||||||
|
// Ret = Json.Decode(Ret);
|
||||||
|
// return Ret;
|
||||||
|
// }
|
||||||
function sq_DeepCopy(original) {
|
function sq_DeepCopy(original) {
|
||||||
local Ret = Json.Encode(original);
|
local RetTable = clone(original);
|
||||||
Ret = Json.Decode(Ret);
|
foreach(Key, Value in original) {
|
||||||
return Ret;
|
if (typeof Value == "table") {
|
||||||
|
RetTable[Key] = sq_DeepCopy(Value);
|
||||||
|
} else if (typeof Value == "array") {
|
||||||
|
RetTable[Key] = sq_DeepCopy(Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return RetTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,20 @@ class Yosin_BaseWindow extends Layer {
|
||||||
Y = null;
|
Y = null;
|
||||||
B_Y = null;
|
B_Y = null;
|
||||||
|
|
||||||
constructor() {
|
function _typeof() {
|
||||||
//构造函数 创建一个空Actor
|
return "Yosin_BaseWindow";
|
||||||
base.constructor();
|
}
|
||||||
|
|
||||||
|
//构造函数
|
||||||
|
constructor(IsWindowFlag = false) {
|
||||||
|
local ObjectBuf;
|
||||||
|
//如果是游戏窗口类 则以Layer为基类 否则以Actor为基类
|
||||||
|
if (IsWindowFlag) {
|
||||||
|
ObjectBuf = LayerActor_Create();
|
||||||
|
base.constructor(ObjectBuf);
|
||||||
|
} else {
|
||||||
|
base.constructor();
|
||||||
|
}
|
||||||
|
|
||||||
//子控件list初始化
|
//子控件list初始化
|
||||||
UI_Childrens = [];
|
UI_Childrens = [];
|
||||||
|
|
@ -111,8 +122,6 @@ class Yosin_BaseWindow extends Layer {
|
||||||
if (Window.UpdateFunc) Window.UpdateFunc(Window, Dt);
|
if (Window.UpdateFunc) Window.UpdateFunc(Window, Dt);
|
||||||
Window.Proc(Dt);
|
Window.Proc(Dt);
|
||||||
}
|
}
|
||||||
//显示才调用Update
|
|
||||||
if (Visible) base.OnUpdate(Dt);
|
|
||||||
}
|
}
|
||||||
//同步坐标
|
//同步坐标
|
||||||
function SyncPos(X, Y) {
|
function SyncPos(X, Y) {
|
||||||
|
|
@ -190,9 +199,10 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
Y = gY;
|
Y = gY;
|
||||||
|
|
||||||
//调用原生方法
|
//调用原生方法
|
||||||
base.constructor();
|
base.constructor(true);
|
||||||
|
|
||||||
SetSize(Width, Height);
|
SetSize(Width, Height);
|
||||||
|
SyncPos(X, Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换到最上层窗口 即得到焦点时 全局窗口才调用 子窗口请不要调用此函数
|
//切换到最上层窗口 即得到焦点时 全局窗口才调用 子窗口请不要调用此函数
|
||||||
|
|
@ -331,6 +341,8 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
//调用原生方法
|
//调用原生方法
|
||||||
base.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
base.OnMouseWheel(Flag, MousePos_X, MousePos_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//创建窗口
|
//创建窗口
|
||||||
|
|
@ -366,6 +378,8 @@ function _Yosin_Windows_Logic_(Dt, Ui_Layer) {
|
||||||
}
|
}
|
||||||
//无论窗口是否显示都需要调用Proc
|
//无论窗口是否显示都需要调用Proc
|
||||||
Window.Proc(Dt);
|
Window.Proc(Dt);
|
||||||
|
//无论是否显示都调用Update
|
||||||
|
Window.OnUpdate(Dt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,15 @@ class _AssetManager_ {
|
||||||
DataTable.growtype[i].name <- name;
|
DataTable.growtype[i].name <- name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//默认时装
|
||||||
|
else if (Key == "[default avatar]") {
|
||||||
|
DataTable.default_avatar <- [];
|
||||||
|
while (true) {
|
||||||
|
local Ret = Data.Get();
|
||||||
|
if (Ret == "[/default avatar]") break;
|
||||||
|
DataTable.default_avatar.append(Ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
//基础属性
|
//基础属性
|
||||||
else if (Key == "[HP MAX]]" || Key == "[MP MAX]]" || Key == "[physical attack]]" || Key == "[physical defense]]" || Key == "[magical attack]]" || Key == "[magical defense]]" || Key == "[inventory limit]]" || Key == "[MP regen speed]]" || Key == "[move speed]]" || Key == "[attack speed]]" || Key == "[cast speed]]" || Key == "[hit recovery]]" || Key == "[jump power]]" || Key == "[weight]]" || Key == "[jump speed]]") {
|
else if (Key == "[HP MAX]]" || Key == "[MP MAX]]" || Key == "[physical attack]]" || Key == "[physical defense]]" || Key == "[magical attack]]" || Key == "[magical defense]]" || Key == "[inventory limit]]" || Key == "[MP regen speed]]" || Key == "[move speed]]" || Key == "[attack speed]]" || Key == "[cast speed]]" || Key == "[hit recovery]]" || Key == "[jump power]]" || Key == "[weight]]" || Key == "[jump speed]]") {
|
||||||
local RealKey = Key.slice(1, Key.len() - 1);
|
local RealKey = Key.slice(1, Key.len() - 1);
|
||||||
|
|
@ -115,7 +124,11 @@ class _AssetManager_ {
|
||||||
EquipmentList = ScriptData.GetFileData("equipment/equipment.lst", function(DataTable, Data) {
|
EquipmentList = ScriptData.GetFileData("equipment/equipment.lst", function(DataTable, Data) {
|
||||||
while (!Data.Eof()) {
|
while (!Data.Eof()) {
|
||||||
local Key = Data.Get();
|
local Key = Data.Get();
|
||||||
DataTable.rawset(Key, Data.Get());
|
//注册装备列表 路径写入 数据未读取
|
||||||
|
DataTable.rawset(Key, {
|
||||||
|
Path = Data.Get(),
|
||||||
|
Data = null
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (_DEBUG_) print("加载装备List完成, 共" + DataTable.len() + "个");
|
if (_DEBUG_) print("加载装备List完成, 共" + DataTable.len() + "个");
|
||||||
});
|
});
|
||||||
|
|
@ -141,7 +154,9 @@ class _AssetManager_ {
|
||||||
function GetEquipment(Idx) {
|
function GetEquipment(Idx) {
|
||||||
//如果没有这件装备则返回
|
//如果没有这件装备则返回
|
||||||
if (!(EquipmentList.rawin(Idx))) return;
|
if (!(EquipmentList.rawin(Idx))) return;
|
||||||
local Path = EquipmentList[Idx];
|
//如果装备数据已经读取过存在了则直接返回
|
||||||
|
if (EquipmentList[Idx].Data) return EquipmentList[Idx].Data;
|
||||||
|
local Path = EquipmentList[Idx].Path;
|
||||||
local m_data = ScriptData.GetFileData("equipment/" + Path, function(DataTable, Data) {
|
local m_data = ScriptData.GetFileData("equipment/" + Path, function(DataTable, Data) {
|
||||||
DataTable.DirPath <- DataTable.filepath.slice(0, DataTable.filepath.lastfind("/") + 1);
|
DataTable.DirPath <- DataTable.filepath.slice(0, DataTable.filepath.lastfind("/") + 1);
|
||||||
while (!Data.Eof()) {
|
while (!Data.Eof()) {
|
||||||
|
|
@ -203,6 +218,7 @@ class _AssetManager_ {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
EquipmentList[Idx].Data = m_data;
|
||||||
return m_data;
|
return m_data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -232,9 +232,7 @@ class Character_Animation extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化
|
//初始化
|
||||||
function Init(...) {
|
function Init(SlotType = false) {
|
||||||
local SlotType = false;
|
|
||||||
if (vargv.len() > 0) SlotType = vargv[0];
|
|
||||||
//读取并设置 等待Ani
|
//读取并设置 等待Ani
|
||||||
ReadAndSetAni("WaitingAni", "waiting motion", SlotType);
|
ReadAndSetAni("WaitingAni", "waiting motion", SlotType);
|
||||||
//读取并设置 移动Ani
|
//读取并设置 移动Ani
|
||||||
|
|
|
||||||
|
|
@ -43,14 +43,14 @@ class GameItem.Equipment extends GameItem.Item {
|
||||||
local EquInfo = AssetManager.GetEquipment(vargv[0]);
|
local EquInfo = AssetManager.GetEquipment(vargv[0]);
|
||||||
if (EquInfo) {
|
if (EquInfo) {
|
||||||
Idx = vargv[0];
|
Idx = vargv[0];
|
||||||
Name = EquInfo["name"];
|
if (EquInfo.rawin("name")) Name = EquInfo["name"];
|
||||||
GetRealEquipmentType(EquInfo["type"].path);
|
if (EquInfo.rawin("type")) GetRealEquipmentType(EquInfo["type"].path);
|
||||||
Minimum_level = EquInfo["minimum level"];
|
if (EquInfo.rawin("minimum level")) Minimum_level = EquInfo["minimum level"];
|
||||||
Grade = EquInfo["grade"];
|
if (EquInfo.rawin("grade")) Grade = EquInfo["grade"];
|
||||||
Job = EquInfo["usable_job"];
|
if (EquInfo.rawin("usable_job")) Job = EquInfo["usable_job"];
|
||||||
Icon = EquInfo["icon"];
|
if (EquInfo.rawin("icon")) Icon = EquInfo["icon"];
|
||||||
Animation_Job = EquInfo["Ani"];
|
if (EquInfo.rawin("Ani")) Animation_Job = EquInfo["Ani"];
|
||||||
DirPath = EquInfo["DirPath"];
|
if (EquInfo.rawin("DirPath")) DirPath = EquInfo["DirPath"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ class GameObject.Character extends GameObject.ActiveObject {
|
||||||
Addchild(AnimationManager);
|
Addchild(AnimationManager);
|
||||||
AnimationManager.Init();
|
AnimationManager.Init();
|
||||||
|
|
||||||
|
foreach(EquId in Info.default_avatar) {
|
||||||
|
local EquObj = GameItem.Equipment(EquId);
|
||||||
|
ChangeEquipment(EquObj);
|
||||||
|
}
|
||||||
//构造属性对象
|
//构造属性对象
|
||||||
// Attribute = AttributeClass();
|
// Attribute = AttributeClass();
|
||||||
}
|
}
|
||||||
|
|
@ -108,12 +112,15 @@ class GameObject.Character extends GameObject.ActiveObject {
|
||||||
|
|
||||||
//通过职业和装备列表来构造一个角色
|
//通过职业和装备列表来构造一个角色
|
||||||
GameObject.CreateCharacter <- function(Job = 0, EquIdList = []) {
|
GameObject.CreateCharacter <- function(Job = 0, EquIdList = []) {
|
||||||
|
|
||||||
//构造角色
|
//构造角色
|
||||||
local Character = GameObject.Character();
|
local Character = GameObject.Character();
|
||||||
Character.Init(Job);
|
Character.Init(Job);
|
||||||
foreach(EquId in EquIdList) {
|
foreach(EquId in EquIdList) {
|
||||||
local EquObj = GameItem.Equipment(EquId);
|
if (EquId > 0) {
|
||||||
Character.ChangeEquipment(EquObj);
|
local EquObj = GameItem.Equipment(EquId);
|
||||||
|
Character.ChangeEquipment(EquObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Character;
|
return Character;
|
||||||
}
|
}
|
||||||
|
|
@ -26,6 +26,7 @@ class MySocket extends Socket {
|
||||||
State = 1;
|
State = 1;
|
||||||
}.bindenv(this));
|
}.bindenv(this));
|
||||||
BindFunc(SOCKET_CALLBACK_TYPE.onReceive, function(PacketId, Str) {
|
BindFunc(SOCKET_CALLBACK_TYPE.onReceive, function(PacketId, Str) {
|
||||||
|
// print("收到消息:" + PacketId + " " + Str);
|
||||||
//如果存在对应处理逻辑
|
//如果存在对应处理逻辑
|
||||||
if (PackHandler.rawin(PacketId)) {
|
if (PackHandler.rawin(PacketId)) {
|
||||||
//将字符画序列化json
|
//将字符画序列化json
|
||||||
|
|
@ -57,8 +58,10 @@ class MySocket extends Socket {
|
||||||
|
|
||||||
//发包
|
//发包
|
||||||
function Send(PacketId, Jso) {
|
function Send(PacketId, Jso) {
|
||||||
//将json序列化字符串
|
local SendObject;
|
||||||
local Str = Json.Encode(Jso);
|
if (typeof Jso == "table") SendObject = Json.Encode(Jso); //table转json字符串 字符串包
|
||||||
Socket_SendPacket(getroottable()._MySocket_.Client, PacketId, Str);
|
else if (typeof Jso == "blob") SendObject = Jso; //字节流包
|
||||||
|
else SendObject = ""; //空包
|
||||||
|
Socket_SendPacket(getroottable()._MySocket_.Client, PacketId, SendObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
*/
|
*/
|
||||||
function InitGame() {
|
function InitGame() {
|
||||||
//初始化Socekt连接
|
//初始化Socekt连接
|
||||||
// MySocket("192.168.200.24", 19666);
|
MySocket("192.168.200.15", 19003);
|
||||||
MySocket("127.0.0.1", 19666);
|
// MySocket("127.0.0.1", 19666);
|
||||||
|
|
||||||
//设定全局默认音量
|
//设定全局默认音量
|
||||||
_Globa_Audio_Volume_ = 0.1;
|
_Globa_Audio_Volume_ = 0.1;
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,9 @@ function TestStage() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
|
||||||
|
|
||||||
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
|
||||||
local T = {
|
|
||||||
Background = 0
|
|
||||||
}
|
|
||||||
Window.Init(T);
|
|
||||||
|
|
||||||
// local Fontobj = Font();
|
// local Fontobj = Font();
|
||||||
|
|
||||||
|
|
@ -54,4 +49,28 @@ function TestStage() {
|
||||||
// Charc.SetAnimation("RestAni");
|
// Charc.SetAnimation("RestAni");
|
||||||
// Charc.SetZOrder(99999999);
|
// Charc.SetZOrder(99999999);
|
||||||
// MapObj.Addchild(Charc);
|
// MapObj.Addchild(Charc);
|
||||||
|
|
||||||
|
|
||||||
|
// local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
// local T = {
|
||||||
|
// Background = 1,
|
||||||
|
// Charc = [{
|
||||||
|
// Job = 0,
|
||||||
|
// Ava = [601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]
|
||||||
|
// }, {
|
||||||
|
// Job = 0,
|
||||||
|
// Ava = [601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]
|
||||||
|
// }, {
|
||||||
|
// Job = 0,
|
||||||
|
// Ava = [601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]
|
||||||
|
// }, {
|
||||||
|
// Job = 0,
|
||||||
|
// Ava = [601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]
|
||||||
|
// }, {
|
||||||
|
// Job = 0,
|
||||||
|
// Ava = [601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]
|
||||||
|
// }]
|
||||||
|
// };
|
||||||
|
// Window.Init(T);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -9,19 +9,44 @@ class Yosin_DragButton extends Yosin_CommonUi {
|
||||||
Path = "";
|
Path = "";
|
||||||
//索引
|
//索引
|
||||||
Idx = 0;
|
Idx = 0;
|
||||||
|
//方向
|
||||||
|
Direction = true;
|
||||||
|
|
||||||
//按钮
|
//按钮
|
||||||
Button = null;
|
Button = null;
|
||||||
|
|
||||||
|
//变动位置回调函数
|
||||||
|
OnChange = null;
|
||||||
|
|
||||||
|
//鼠标相对位置
|
||||||
|
M_Xpos = null;
|
||||||
|
M_Ypos = null;
|
||||||
|
//未移动时的初始坐标
|
||||||
|
BasePos = null;
|
||||||
|
//移动Flag
|
||||||
|
MoveFlag = false;
|
||||||
|
//最大移动值
|
||||||
|
Max_Move_Value = 0;
|
||||||
|
//移动值
|
||||||
|
Move_Value = 0;
|
||||||
|
//侦测值
|
||||||
|
Detect_Value = 0;
|
||||||
|
|
||||||
constructor(X, Y, W, H, Path, Idx, Direction = true, UnavailableFlag = true) {
|
constructor(X, Y, W, H, Path, Idx, Direction = true, UnavailableFlag = true) {
|
||||||
this.Path = Path;
|
this.Path = Path;
|
||||||
this.Idx = Idx;
|
this.Idx = Idx;
|
||||||
|
this.Direction = Direction;
|
||||||
base.constructor(X, Y, W, H);
|
base.constructor(X, Y, W, H);
|
||||||
|
|
||||||
Button = Yosin_SplicingButton(0, 0, W, H, Path, Idx, Direction, UnavailableFlag);
|
Button = Yosin_SplicingButton(0, 0, W, H, Path, Idx, Direction, UnavailableFlag);
|
||||||
Button.DownSimulateOffset = false;
|
Button.DownSimulateOffset = false;
|
||||||
AddUIChild(Button);
|
AddUIChild(Button);
|
||||||
|
|
||||||
|
BasePos = {
|
||||||
|
x = X,
|
||||||
|
y = Y
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//override
|
//override
|
||||||
|
|
@ -29,5 +54,55 @@ class Yosin_DragButton extends Yosin_CommonUi {
|
||||||
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
||||||
base.OnMouseLbDown(MousePos_X, MousePos_Y);
|
base.OnMouseLbDown(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
if (isInRect) {
|
||||||
|
MoveFlag = true;
|
||||||
|
M_Xpos = MousePos_X; //原始鼠标位置数据
|
||||||
|
M_Ypos = MousePos_Y;
|
||||||
|
B_X = X; //原始窗口位置
|
||||||
|
B_Y = Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//override
|
||||||
|
function OnMouseProc(MousePos_X, MousePos_Y) {
|
||||||
|
//调用原生方法
|
||||||
|
base.OnMouseProc(MousePos_X, MousePos_Y);
|
||||||
|
|
||||||
|
//移动
|
||||||
|
if (MoveFlag) {
|
||||||
|
//左键拖动
|
||||||
|
if (Direction) {
|
||||||
|
Move_Value = B_X + (MousePos_X - M_Xpos);
|
||||||
|
if (!(Move_Value >= (0 + BasePos.x) && Move_Value <= (Max_Move_Value - Width + BasePos.x))) {
|
||||||
|
X = Move_Value;
|
||||||
|
DragLogic((Move_Value - Localtion_X).tofloat() / (Max_Move_Value - Width + BasePos.x - Localtion_X).tofloat());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Move_Value = B_Y + (MousePos_Y - M_Ypos);
|
||||||
|
if (Move_Value >= (0 + BasePos.y) && Move_Value <= (Max_Move_Value - Height + BasePos.y)) {
|
||||||
|
Y = (Move_Value);
|
||||||
|
DragLogic((Move_Value - Localtion_Y).tofloat() / (Max_Move_Value - Height + BasePos.y - Localtion_Y).tofloat());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SyncPos(X, Y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//拖动逻辑
|
||||||
|
function DragLogic(Value) {
|
||||||
|
Detect_Value = Value;
|
||||||
|
if (OnChange) OnChange(Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//鼠标左键弹起回调
|
||||||
|
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
||||||
|
base.OnMouseLbUp(MousePos_X, MousePos_Y);
|
||||||
|
MoveFlag = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置最大移动值
|
||||||
|
function SetMaxMoveValue(Value) {
|
||||||
|
Max_Move_Value = Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
创建日期:2024-12-13 23:17
|
创建日期:2024-12-13 23:17
|
||||||
文件用途:
|
文件用途:
|
||||||
*/
|
*/
|
||||||
//基础按钮
|
//滚动条
|
||||||
class Yosin_ScrollBar extends Yosin_CommonUi {
|
class Yosin_ScrollBar extends Yosin_CommonUi {
|
||||||
//控制器
|
//控制器
|
||||||
Controller = null;
|
Controller = null;
|
||||||
|
|
@ -14,18 +14,22 @@ class Yosin_ScrollBar extends Yosin_CommonUi {
|
||||||
|
|
||||||
//上按钮
|
//上按钮
|
||||||
UpButton = null;
|
UpButton = null;
|
||||||
|
//滚动按钮
|
||||||
|
ScrollButton = null;
|
||||||
//下按钮
|
//下按钮
|
||||||
DownButton = null;
|
DownButton = null;
|
||||||
|
|
||||||
|
//回调函数
|
||||||
|
OnChange = null;
|
||||||
|
|
||||||
//Path
|
//Path
|
||||||
Path = "sprite/interface/lenheartwindowcommon.img";
|
Path = "sprite/interface/lenheartwindowcommon.img";
|
||||||
|
|
||||||
constructor(X, Y, H, gSize) {
|
constructor(X, Y, H, S_H) {
|
||||||
base.constructor(X, Y, 9, H > 26 ? H : 26);
|
base.constructor(X, Y, 9, H > 26 ? H : 26);
|
||||||
|
|
||||||
Controller = {
|
Controller = {
|
||||||
CurPos = 0,
|
CurPos = 0,
|
||||||
Size = gSize
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//上按钮
|
//上按钮
|
||||||
|
|
@ -37,6 +41,9 @@ class Yosin_ScrollBar extends Yosin_CommonUi {
|
||||||
AddUIChild(UpButton);
|
AddUIChild(UpButton);
|
||||||
|
|
||||||
//滚动条
|
//滚动条
|
||||||
|
ScrollButton = Yosin_DragButton(0, 13, 9, S_H, Path, 184, false, false);
|
||||||
|
ScrollButton.SetMaxMoveValue(Height - 26);
|
||||||
|
AddUIChild(ScrollButton);
|
||||||
|
|
||||||
//下按钮
|
//下按钮
|
||||||
DownButton = Yosin_BaseButton(0, Height - 13, 9, 13, Path, 22);
|
DownButton = Yosin_BaseButton(0, Height - 13, 9, 13, Path, 22);
|
||||||
|
|
@ -50,6 +57,11 @@ class Yosin_ScrollBar extends Yosin_CommonUi {
|
||||||
|
|
||||||
function Proc(Dt) {
|
function Proc(Dt) {
|
||||||
base.Proc(Dt);
|
base.Proc(Dt);
|
||||||
|
Controller.CurPos = ScrollButton.Detect_Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SetChangeCallBack(Func) {
|
||||||
|
ScrollButton.OnChange = Func;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -19,6 +19,9 @@ class _Login_Window extends Yosin_Window {
|
||||||
|
|
||||||
BackGroundMusic = null;
|
BackGroundMusic = null;
|
||||||
|
|
||||||
|
//信息
|
||||||
|
PackInfo = null;
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
|
@ -30,6 +33,35 @@ class _Login_Window extends Yosin_Window {
|
||||||
|
|
||||||
//播放音乐
|
//播放音乐
|
||||||
PlayBackgroundMusic();
|
PlayBackgroundMusic();
|
||||||
|
|
||||||
|
//注册登录回调包
|
||||||
|
MySocket.RegisterHandler(2, function(Jso) {
|
||||||
|
//登录成功
|
||||||
|
if (Jso.state) {
|
||||||
|
HUD_Message(500, 200, "登录成功,正在进入游戏...");
|
||||||
|
MySocket.Send(9, null);
|
||||||
|
} else {
|
||||||
|
HUD_Message(500, 200, "登录失败");
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
|
||||||
|
//注册获取角色列表回包
|
||||||
|
MySocket.RegisterHandler(10, function(Jso) {
|
||||||
|
PackInfo = Jso;
|
||||||
|
}.bindenv(this));
|
||||||
|
//注册获取角色列表的装备回包
|
||||||
|
MySocket.RegisterBinaryHandler(10, function(Blob) {
|
||||||
|
Blob.readn('i');
|
||||||
|
foreach(info in PackInfo.charac) {
|
||||||
|
info.equip <- [];
|
||||||
|
for (local i = 0; i< 15; i++) {
|
||||||
|
local value = Blob.readn('i');
|
||||||
|
info.equip.append(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
Window.Init(PackInfo);
|
||||||
|
}.bindenv(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
function PlayBackgroundMusic() {
|
function PlayBackgroundMusic() {
|
||||||
|
|
@ -62,7 +94,9 @@ class _Login_Window extends Yosin_Window {
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
|
|
||||||
//登录按钮文本
|
//登录按钮文本
|
||||||
local LoginTextActor = FontAssetManager.GenerateNormal("登录", sq_RGBA(200, 195, 169, 255), true);
|
local LoginTextActor = FontAssetManager.GenerateNormal("登录", true, {
|
||||||
|
color = sq_RGBA(200, 195, 169, 255)
|
||||||
|
});
|
||||||
LoginTextActor.SetPosition(26, 4);
|
LoginTextActor.SetPosition(26, 4);
|
||||||
LoginButton.Addchild(LoginTextActor);
|
LoginButton.Addchild(LoginTextActor);
|
||||||
AddUIChild(LoginButton);
|
AddUIChild(LoginButton);
|
||||||
|
|
@ -77,7 +111,9 @@ class _Login_Window extends Yosin_Window {
|
||||||
})
|
})
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
//注册按钮文本
|
//注册按钮文本
|
||||||
local RegisterTextActor = FontAssetManager.GenerateNormal("注册", sq_RGBA(200, 195, 169, 255), true);
|
local RegisterTextActor = FontAssetManager.GenerateNormal("注册", true, {
|
||||||
|
color = sq_RGBA(200, 195, 169, 255)
|
||||||
|
});
|
||||||
RegisterTextActor.SetPosition(26, 4);
|
RegisterTextActor.SetPosition(26, 4);
|
||||||
RegisterButton.Addchild(RegisterTextActor);
|
RegisterButton.Addchild(RegisterTextActor);
|
||||||
AddUIChild(RegisterButton);
|
AddUIChild(RegisterButton);
|
||||||
|
|
@ -107,11 +143,15 @@ class _Login_Window extends Yosin_Window {
|
||||||
LoginText.Addchild(LoginTexttip);
|
LoginText.Addchild(LoginTexttip);
|
||||||
|
|
||||||
//账号
|
//账号
|
||||||
local AccountTextActor = FontAssetManager.GenerateNormal("账号:", sq_RGBA(200, 195, 169, 255), false);
|
local AccountTextActor = FontAssetManager.GenerateNormal("账号:", false, {
|
||||||
|
color = sq_RGBA(200, 195, 169, 255)
|
||||||
|
});
|
||||||
AccountTextActor.SetPosition(720, 241);
|
AccountTextActor.SetPosition(720, 241);
|
||||||
Addchild(AccountTextActor);
|
Addchild(AccountTextActor);
|
||||||
//密码
|
//密码
|
||||||
local PasswordTextActor = FontAssetManager.GenerateNormal("密码:", sq_RGBA(200, 195, 169, 255), false);
|
local PasswordTextActor = FontAssetManager.GenerateNormal("密码:", false, {
|
||||||
|
color = sq_RGBA(200, 195, 169, 255)
|
||||||
|
});
|
||||||
PasswordTextActor.SetPosition(720, 281);
|
PasswordTextActor.SetPosition(720, 281);
|
||||||
Addchild(PasswordTextActor);
|
Addchild(PasswordTextActor);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,16 +82,16 @@ class _Select_Character_SettingBackground_Window extends Yosin_Window {
|
||||||
//选择背景按钮集合
|
//选择背景按钮集合
|
||||||
SettingBackgroundButtonList = null;
|
SettingBackgroundButtonList = null;
|
||||||
|
|
||||||
|
//背景对象
|
||||||
Background = null;
|
Background = null;
|
||||||
|
|
||||||
|
ScrollObject = null;
|
||||||
|
|
||||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
SettingBackgroundButtonList = [];
|
SettingBackgroundButtonList = [];
|
||||||
|
|
||||||
// SetClipRect(-gWidth, 0, gWidth, gHeight + 20);
|
SetClipRect(5, 9, gWidth, gHeight - 9);
|
||||||
// SetClipRect(0, 0, 1066, 600);
|
|
||||||
// ShowBorder(true);
|
|
||||||
// SetLayerOpacity(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Init() {
|
function Init() {
|
||||||
|
|
@ -102,25 +102,72 @@ class _Select_Character_SettingBackground_Window extends Yosin_Window {
|
||||||
function RegisterDraw() {
|
function RegisterDraw() {
|
||||||
//背景
|
//背景
|
||||||
Background = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/setup/setup.img", 17);
|
Background = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/setup/setup.img", 17);
|
||||||
Addchild(Background);
|
Background.SetPosition(X, Y);
|
||||||
|
Background.SetZOrder(-10);
|
||||||
|
Background.SetVisible(false);
|
||||||
|
//因为裁切原因 所以要添加到父对象中
|
||||||
|
Parent.Addchild(Background);
|
||||||
|
|
||||||
for (local i = 0; i< 24; i++) {
|
for (local i = 0; i< 24; i++) {
|
||||||
local Buf = _Select_Character_SettingBackground_Object_Window(5 + (101 * (i % 2)), 9 + (61 * (i / 2)), 91, 51, i);
|
local Buf = _Select_Character_SettingBackground_Object_Window(5 + (101 * (i % 2)), 9 + (61 * (i / 2)), 91, 51, i);
|
||||||
SettingBackgroundButtonList.push(Buf);
|
SettingBackgroundButtonList.push(Buf);
|
||||||
//如果是父对象默认构造的默认是勾选状态
|
//如果是父对象默认构造的默认是勾选状态
|
||||||
if (i == Parent.Info.Background) {
|
if (i == Parent.Info.loginImg) {
|
||||||
Buf.SelectMask.SetVisible(true);
|
Buf.SelectMask.SetVisible(true);
|
||||||
Buf.SelectFlag = true;
|
Buf.SelectFlag = true;
|
||||||
}
|
}
|
||||||
AddUIChild(Buf);
|
AddUIChild(Buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScrollObject = Yosin_ScrollBar(Width - 13, 5, Height - 8, 20);
|
||||||
|
ScrollObject.SetChangeCallBack(function(Value) {
|
||||||
|
foreach(Pos, Button in SettingBackgroundButtonList) {
|
||||||
|
Button.SetPosition(5 + (101 * (Pos % 2)), 9 + (61 * (Pos / 2)) - Value * (61 * 12));
|
||||||
|
}
|
||||||
|
}.bindenv(this));
|
||||||
|
AddUIChild(ScrollObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//逻辑入口
|
//override
|
||||||
function Proc(Dt) {
|
//设置是否可见 通过重载设置可见同步Background的可见性
|
||||||
SyncPos(X, Y);
|
function SetVisible(Flag) {
|
||||||
base.Proc(Dt);
|
base.SetVisible(Flag);
|
||||||
|
if (Flag) {
|
||||||
|
if (Background) Background.SetVisible(true);
|
||||||
|
} else {
|
||||||
|
if (Background) Background.SetVisible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//角色
|
||||||
|
class _Select_Character_Chr extends Yosin_Window {
|
||||||
|
//是否为独立窗口
|
||||||
|
IsIndependent = false;
|
||||||
|
|
||||||
|
Info = null;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
RegisterDraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
function Init(Info) {
|
||||||
|
this.Info = Info;
|
||||||
|
RegisterCharac();
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterDraw() {
|
||||||
|
local Magic = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/selectcharacter.img", 10);
|
||||||
|
Addchild(Magic);
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterCharac() {
|
||||||
|
local Charc = GameObject.CreateCharacter(Info.job, Info.equip);
|
||||||
|
Charc.SetAnimation("RestAni");
|
||||||
|
Charc.SetPosition(48, 12, 0);
|
||||||
|
Addchild(Charc);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -141,6 +188,8 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
SettingBackgroundWindow = null;
|
SettingBackgroundWindow = null;
|
||||||
//背景图片
|
//背景图片
|
||||||
BackGround = null;
|
BackGround = null;
|
||||||
|
//角色遮罩栏
|
||||||
|
CharacterMaskBox = null;
|
||||||
|
|
||||||
//信息
|
//信息
|
||||||
Info = null;
|
Info = null;
|
||||||
|
|
@ -157,6 +206,9 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
//注册绘制
|
//注册绘制
|
||||||
RegisterDraw();
|
RegisterDraw();
|
||||||
//注册控件
|
//注册控件
|
||||||
|
// for (local i = 0; i< 50; i++) {
|
||||||
|
// RegisterWidget();
|
||||||
|
// }
|
||||||
RegisterWidget();
|
RegisterWidget();
|
||||||
//注册窗口
|
//注册窗口
|
||||||
RegisterWindow();
|
RegisterWindow();
|
||||||
|
|
@ -181,6 +233,13 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
AddUIChild(SettingBackgroundWindow);
|
AddUIChild(SettingBackgroundWindow);
|
||||||
//先添加为子对象 因为子对象需要用到父对象
|
//先添加为子对象 因为子对象需要用到父对象
|
||||||
SettingBackgroundWindow.Init();
|
SettingBackgroundWindow.Init();
|
||||||
|
|
||||||
|
//角色对象
|
||||||
|
for (local i = 0; i< 5; i++) {
|
||||||
|
local Buf = _Select_Character_Chr("选择角色角色对象" + i, 190 + (i * 144), ((i % 2) ? 15 : 0) + 225, 126, 208, 0);
|
||||||
|
if (i< Info.charac.len()) Buf.Init(Info.charac[i]);
|
||||||
|
AddUIChild(Buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
|
|
@ -192,7 +251,9 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
AddUIChild(SettingButton);
|
AddUIChild(SettingButton);
|
||||||
//登录按钮文本
|
//登录按钮文本
|
||||||
local LoginTextActor = FontAssetManager.GenerateNormal("背景设置", sq_RGBA(221, 197, 147, 255), true);
|
local LoginTextActor = FontAssetManager.GenerateNormal("背景设置", true, {
|
||||||
|
color = sq_RGBA(221, 197, 147, 255)
|
||||||
|
});
|
||||||
LoginTextActor.SetPosition(23, 3);
|
LoginTextActor.SetPosition(23, 3);
|
||||||
LoginTextActor.SetUpdateFunc(function(Text, Dt) {
|
LoginTextActor.SetUpdateFunc(function(Text, Dt) {
|
||||||
if (Text.Parent.State == 1 || Text.Parent.State == 2) {
|
if (Text.Parent.State == 1 || Text.Parent.State == 2) {
|
||||||
|
|
@ -203,14 +264,6 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
})
|
})
|
||||||
SettingButton.Addchild(LoginTextActor);
|
SettingButton.Addchild(LoginTextActor);
|
||||||
|
|
||||||
|
|
||||||
// local TestButton = Yosin_ScrollBar(300, 200, 50, 100);
|
|
||||||
// AddUIChild(TestButton);
|
|
||||||
// local TestButton = Yosin_SplicingButton(200, 200, 77, 68, "sprite/interface/lenheartwindowcommon.img", 184, false, false);
|
|
||||||
// TestButton.DownSimulateOffset = false;
|
|
||||||
local TestButton = Yosin_DragButton(200, 200, 9, 120, "sprite/interface/lenheartwindowcommon.img", 184, false, false);
|
|
||||||
// TestButton.SetScale(5.0, 5.0);
|
|
||||||
AddUIChild(TestButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换背景
|
//切换背景
|
||||||
|
|
@ -220,23 +273,18 @@ class _Select_Character_Window extends Yosin_Window {
|
||||||
BackGround = null;
|
BackGround = null;
|
||||||
}
|
}
|
||||||
BackGround = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx);
|
BackGround = CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx);
|
||||||
BackGround.SetZOrder(-10);
|
BackGround.SetZOrder(-100);
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
BackGround = Layer();
|
|
||||||
BackGround.Addchild(CL_SpriteObject("sprite/interface2/selectcharacter_ver2/background/large/background_large_event.img", Idx));
|
|
||||||
BackGround.SetZOrder(-10);
|
|
||||||
BackGround.SetPosition(100, 100);
|
|
||||||
BackGround.SetClipRect(0, 0, 200, 200);
|
|
||||||
|
|
||||||
*/
|
|
||||||
Addchild(BackGround);
|
Addchild(BackGround);
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterDraw() {
|
function RegisterDraw() {
|
||||||
//大背景 根据玩家的设定背景决定
|
//大背景 根据玩家的设定背景决定
|
||||||
ChangeBackground(Info.Background);
|
ChangeBackground(Info.loginImg);
|
||||||
|
|
||||||
|
//角色遮罩栏
|
||||||
|
CharacterMaskBox = Yosin_NineBoxStretch(-4, 330, 1074, 680, "sprite/interface/lenheartwindowcommon.img", 0);
|
||||||
|
AddUIChild(CharacterMaskBox);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,10 @@ class HUD_Message extends Yosin_Window {
|
||||||
horizontalMargin = 20,
|
horizontalMargin = 20,
|
||||||
// 垂直边距
|
// 垂直边距
|
||||||
verticalMargin = 20,
|
verticalMargin = 20,
|
||||||
} ) {
|
}) {
|
||||||
|
|
||||||
local title = info.rawin("title") ? info.title : "公告";
|
local title = info.rawin("title") ? info.title : "公告";
|
||||||
local horizontalMargin = info.rawin("horizontalMargin") ? info.horizontalMargin : 20;
|
local horizontalMargin = info.rawin("horizontalMargin") ? info.horizontalMargin : 20;
|
||||||
local verticalMargin = info.rawin("verticalMargin") ? info.verticalMargin : 20;
|
local verticalMargin = info.rawin("verticalMargin") ? info.verticalMargin : 20;
|
||||||
|
|
||||||
// 标题
|
// 标题
|
||||||
|
|
@ -59,17 +59,16 @@ class HUD_Message extends Yosin_Window {
|
||||||
local verticalMargin = 50 + verticalMargin * 2;
|
local verticalMargin = 50 + verticalMargin * 2;
|
||||||
cacheH = messageTextActor.GetSize().h + verticalMargin;
|
cacheH = messageTextActor.GetSize().h + verticalMargin;
|
||||||
|
|
||||||
print("cacheW:" + cacheW.tostring());
|
|
||||||
print("cacheH:" + cacheH.tostring());
|
|
||||||
|
|
||||||
// 默认构造数据
|
// 默认构造数据
|
||||||
base.constructor("公告或信息弹窗" + clock().tostring() , gX, gY, cacheW, cacheH, 20);
|
base.constructor("公告或信息弹窗" + clock().tostring(), gX, gY, cacheW, cacheH, 20);
|
||||||
|
|
||||||
|
|
||||||
//注册控件
|
//注册控件
|
||||||
RegisterWidget();
|
RegisterWidget();
|
||||||
//注册绘制
|
//注册绘制
|
||||||
RegisterDraw();
|
RegisterDraw();
|
||||||
|
|
||||||
|
ResetFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
|
|
@ -84,9 +83,10 @@ class HUD_Message extends Yosin_Window {
|
||||||
AddUIChild(titleBackground);
|
AddUIChild(titleBackground);
|
||||||
|
|
||||||
//确认按钮
|
//确认按钮
|
||||||
local confirmButton = Yosin_BaseButton( cacheW / 2 - 28, cacheH - 15, 56, 24 "sprite/interface/lenheartwindowcommon.img", 12);
|
local confirmButton = Yosin_BaseButton(cacheW / 2 - 28, cacheH - 15, 56, 24 "sprite/interface/lenheartwindowcommon.img", 12);
|
||||||
confirmButton.OnClick = function(Button) {
|
confirmButton.OnClick = function(Button) {
|
||||||
this.RemoveSelf();
|
//关闭本窗口
|
||||||
|
CloseWindow();
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
AddUIChild(confirmButton);
|
AddUIChild(confirmButton);
|
||||||
|
|
||||||
|
|
@ -96,9 +96,10 @@ class HUD_Message extends Yosin_Window {
|
||||||
confirmButton.Addchild(confirmTextActor);
|
confirmButton.Addchild(confirmTextActor);
|
||||||
|
|
||||||
//关闭按钮
|
//关闭按钮
|
||||||
local closeButton = Yosin_BaseButton( cacheW - 15, 5, 10, 9 "sprite/interface/lenheartwindowcommon.img", 42);
|
local closeButton = Yosin_BaseButton(cacheW - 15, 5, 10, 9 "sprite/interface/lenheartwindowcommon.img", 42);
|
||||||
closeButton.OnClick = function(Button) {
|
closeButton.OnClick = function(Button) {
|
||||||
this.RemoveSelf();
|
//关闭本窗口
|
||||||
|
CloseWindow();
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
AddUIChild(closeButton);
|
AddUIChild(closeButton);
|
||||||
|
|
||||||
|
|
@ -109,7 +110,7 @@ class HUD_Message extends Yosin_Window {
|
||||||
|
|
||||||
local titleX = cacheW / 2 - titleTextActor.GetSize().w / 2;
|
local titleX = cacheW / 2 - titleTextActor.GetSize().w / 2;
|
||||||
// 绘制标题
|
// 绘制标题
|
||||||
titleTextActor.SetPosition( titleX , 2);
|
titleTextActor.SetPosition(titleX, 2);
|
||||||
Addchild(titleTextActor);
|
Addchild(titleTextActor);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -117,7 +118,7 @@ class HUD_Message extends Yosin_Window {
|
||||||
local messageY = cacheH / 2 - messageTextActor.GetSize().h / 2;
|
local messageY = cacheH / 2 - messageTextActor.GetSize().h / 2;
|
||||||
|
|
||||||
// 绘制内容
|
// 绘制内容
|
||||||
messageTextActor.SetPosition( messageX , messageY );
|
messageTextActor.SetPosition(messageX, messageY);
|
||||||
Addchild(messageTextActor);
|
Addchild(messageTextActor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,14 @@
|
||||||
|
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
|
|
||||||
|
|
||||||
local Game = GameWindow();
|
local Game = GameWindow();
|
||||||
Game.title = "Yosin & Kiwano";
|
Game.title = "Yosin & Kiwano";
|
||||||
Game.bg_color = [255.0, 255.0, 255.0, 255.0];
|
Game.bg_color = [255.0, 255.0, 255.0, 255.0];
|
||||||
Game.size = [1066, 600];
|
Game.size = [1066, 600];
|
||||||
Game.v_sync = false;
|
Game.v_sync = false;
|
||||||
Game.frame_interval = 10000;
|
Game.frame_interval = 10000;
|
||||||
Game.debug_mode = true;
|
// Game.debug_mode = true;
|
||||||
Game.Run(LoginStage);
|
Game.Run(LoginStage);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue