Compare commits
No commits in common. "e22be02576f8f1de148aa00d86ec060598321b18" and "83e4f44d6b2665d6c9f32d09e271a68132dde85c" have entirely different histories.
e22be02576
...
83e4f44d6b
BIN
Yosin_Engine.exe
BIN
Yosin_Engine.exe
Binary file not shown.
|
|
@ -9,6 +9,41 @@ class TextActor extends CL_BaseObject {
|
||||||
//不需要Update函数
|
//不需要Update函数
|
||||||
NoUpdate = true;
|
NoUpdate = true;
|
||||||
|
|
||||||
|
OutlineChild = null;
|
||||||
|
Strokeoffsets = [{
|
||||||
|
x = 1,
|
||||||
|
y = 0
|
||||||
|
}, // 右
|
||||||
|
{
|
||||||
|
x = 1,
|
||||||
|
y = 1
|
||||||
|
}, // 右上
|
||||||
|
{
|
||||||
|
x = 0,
|
||||||
|
y = 1
|
||||||
|
}, // 上
|
||||||
|
{
|
||||||
|
x = -1,
|
||||||
|
y = 1
|
||||||
|
}, // 左上
|
||||||
|
{
|
||||||
|
x = -1,
|
||||||
|
y = 0
|
||||||
|
}, // 左
|
||||||
|
{
|
||||||
|
x = -1,
|
||||||
|
y = -1
|
||||||
|
}, // 左下
|
||||||
|
{
|
||||||
|
x = 0,
|
||||||
|
y = -1
|
||||||
|
}, // 下
|
||||||
|
{
|
||||||
|
x = 1,
|
||||||
|
y = -1
|
||||||
|
} // 右下
|
||||||
|
];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @函数作用: 构造文本精灵
|
* @函数作用: 构造文本精灵
|
||||||
* @参数 font 可传入全局font Id 或 传入 font对象
|
* @参数 font 可传入全局font Id 或 传入 font对象
|
||||||
|
|
@ -40,11 +75,16 @@ class TextActor extends CL_BaseObject {
|
||||||
//设置文本内容
|
//设置文本内容
|
||||||
function SetText(str) {
|
function SetText(str) {
|
||||||
TextActor_SetText(this.C_Object, str);
|
TextActor_SetText(this.C_Object, str);
|
||||||
|
if (OutlineChild) {
|
||||||
|
foreach(obj in OutlineChild) {
|
||||||
|
obj.SetText(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置描边
|
//设置描边
|
||||||
function SetOutline(color = Color.Black, flag = true) {
|
function SetOutline(width, color = Color.Black, cap = CapStyle.Square, line_join = LineJoinStyle.Round, dash = DashStyle.Solid) {
|
||||||
TextActor_SetOutLine(this.C_Object, color, flag);
|
TextActor_SetOutLine(this.C_Object, width, color, cap, line_join, dash);
|
||||||
}
|
}
|
||||||
|
|
||||||
// //设置描边
|
// //设置描边
|
||||||
|
|
|
||||||
|
|
@ -211,8 +211,6 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
|
|
||||||
//是否为独立窗口
|
//是否为独立窗口
|
||||||
IsIndependent = true;
|
IsIndependent = true;
|
||||||
//是否为顶层窗口
|
|
||||||
IsTop = false;
|
|
||||||
|
|
||||||
//是否为图层窗口
|
//是否为图层窗口
|
||||||
IsLayer = false;
|
IsLayer = false;
|
||||||
|
|
@ -243,14 +241,14 @@ class Yosin_Window extends Yosin_BaseWindow {
|
||||||
this.Visible = true;
|
this.Visible = true;
|
||||||
//遍历全局窗口数组将自己移除重新添加在末尾
|
//遍历全局窗口数组将自己移除重新添加在末尾
|
||||||
foreach(Index, WindowObj in _SYS_WINDOW_LIST_) {
|
foreach(Index, WindowObj in _SYS_WINDOW_LIST_) {
|
||||||
WindowObj.SetZOrder(10000000 + Index + (WindowObj.IsTop ? 10000000 : 0));
|
WindowObj.SetZOrder(10000000 + Index);
|
||||||
if (WindowObj.ObjectId == this.ObjectId) {
|
if (WindowObj.ObjectId == this.ObjectId) {
|
||||||
_SYS_WINDOW_LIST_.remove(Index);
|
_SYS_WINDOW_LIST_.remove(Index);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_SYS_WINDOW_LIST_.append(this);
|
_SYS_WINDOW_LIST_.append(this);
|
||||||
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len() + (IsTop ? 10000000 : 0));
|
SetZOrder(10000000 + _SYS_WINDOW_LIST_.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -369,10 +369,11 @@ class Character_Animation extends Actor {
|
||||||
//初始化名字
|
//初始化名字
|
||||||
function InitName() {
|
function InitName() {
|
||||||
//创建名字对象
|
//创建名字对象
|
||||||
Name = FontAssetManager.GenerateNormal("", true, {
|
Name = FontAssetManager.GenerateNormal("", false, {
|
||||||
color = sq_RGBA(209, 185, 148, 255),
|
color = sq_RGBA(209, 185, 148, 255),
|
||||||
|
alignment = TextAlign.Center
|
||||||
});
|
});
|
||||||
Name.SetPosition(ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job].x, ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job].y);
|
Name.SetPosition(ENUM_RINDRO_JOB_TITLE_HEIGHT[Parent.Job]);
|
||||||
Name.SetZOrder(80000);
|
Name.SetZOrder(80000);
|
||||||
Addchild(Name);
|
Addchild(Name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ class _FontAssetManager_ {
|
||||||
//初始化字体
|
//初始化字体
|
||||||
function InitFont() {
|
function InitFont() {
|
||||||
//普通宋体小字
|
//普通宋体小字
|
||||||
Font.PreLoad("Fonts/Gasinamu.ttf");
|
Font.PreLoad("Fonts/GasinamuNew.ttf");
|
||||||
Font("gasinamu", 11.5).Register(0);
|
Font("gasinamuM", 11.5).Register(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -28,7 +28,7 @@ class _FontAssetManager_ {
|
||||||
local TextActor = TextActor(0, style);
|
local TextActor = TextActor(0, style);
|
||||||
TextActor.SetText(text);
|
TextActor.SetText(text);
|
||||||
if (stroke)
|
if (stroke)
|
||||||
TextActor.SetOutline();
|
TextActor.SetOutline(3.0);
|
||||||
return TextActor;
|
return TextActor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -23,8 +23,6 @@ function InitGame() {
|
||||||
_IMouse_();
|
_IMouse_();
|
||||||
//初始化控制器
|
//初始化控制器
|
||||||
_GameController_();
|
_GameController_();
|
||||||
//初始化顶部工具条UI
|
|
||||||
Sq_CreateWindow(_Top_tool, "窗口顶部工具条", 208, 0, 650, 20, 0);
|
|
||||||
|
|
||||||
//预加载
|
//预加载
|
||||||
Animation("ui/charactercreate/dust.ani");
|
Animation("ui/charactercreate/dust.ani");
|
||||||
|
|
|
||||||
|
|
@ -10,71 +10,59 @@ function TestStage() {
|
||||||
T.Enter();
|
T.Enter();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
// local Window = Sq_CreateWindow(_Login_Window, "登录界面窗口", 0, 0, 1066, 600, 0);
|
||||||
|
|
||||||
|
|
||||||
// //大背景
|
|
||||||
// local BackGround = CL_SpriteObject("sprite/interface2/charactercreatever2/characterbackground.img", 14);
|
|
||||||
// T.Addchild(BackGround);
|
|
||||||
|
|
||||||
// //登录按钮文本
|
|
||||||
// local TextActor = TextActor(0, {
|
|
||||||
// color = sq_RGBA(186, 147, 97, 255)
|
|
||||||
// });
|
|
||||||
// TextActor.SetText("测试文字");
|
|
||||||
// TextActor.SetPosition(200, 200);
|
|
||||||
// TextActor.SetZOrder(1000000);
|
|
||||||
// TextActor.SetOutline();
|
|
||||||
// T.Addchild(TextActor);
|
|
||||||
|
|
||||||
// local Fontobj = Font();
|
// local Fontobj = Font();
|
||||||
|
|
||||||
// local TownObj = Town(1);
|
local TownObj = Town(2);
|
||||||
|
|
||||||
|
|
||||||
|
// local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
||||||
|
// // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
|
||||||
// // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
// // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
||||||
// // // local MapObj = Map("map/cataclysm/town/hendonmyre/new_backstreet_2.map");
|
// // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
|
||||||
// // // local MapObj = Map("map/cataclysm/town/seria_room/elvengard.map");
|
// T.Addchild(MapObj);
|
||||||
// // // local MapObj = Map("map/cataclysm/town/sainthorn_heaven/sainthorn_heaven_ship_rear_down.map");
|
|
||||||
// // T.Addchild(MapObj);
|
|
||||||
|
|
||||||
// local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
|
local Charc = GameObject.CreateCharacter(0, [101590007, 27675, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023]);
|
||||||
// // Charc.SetPosition(356, 250, 0);
|
// Charc.SetPosition(356, 250, 0);
|
||||||
// // Charc.SetAnimation("RestAni");
|
// Charc.SetAnimation("RestAni");
|
||||||
// TownObj.AddObject(Charc, true);
|
TownObj.AddObject(Charc, true);
|
||||||
|
|
||||||
|
|
||||||
local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
// local Window = Sq_CreateWindow(_Select_Character_Window, "选择角色界面窗口", 0, 0, 1066, 600, 0);
|
||||||
local T = {
|
// local T = {
|
||||||
loginImg = 1,
|
// loginImg = 1,
|
||||||
charac = [{
|
// charac = [{
|
||||||
lv = 90,
|
// lv = 90,
|
||||||
name = "倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒倾泪寒",
|
// name = "测试角色1",
|
||||||
job = 0,
|
// job = 0,
|
||||||
equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
// equip = [101020001, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
||||||
}, {
|
// }, {
|
||||||
lv = 90,
|
// lv = 90,
|
||||||
name = "倾泪寒222",
|
// name = "测试角色2",
|
||||||
job = 0,
|
// job = 0,
|
||||||
equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
|
// equip = [101020023, 601500059, 601550059, 601560057, 601570052, 601520051, 601500059, 601510058, 601530050, 601540059, 601580022, 609590003]
|
||||||
}, {
|
// }, {
|
||||||
lv = 90,
|
// lv = 90,
|
||||||
name = "Kina",
|
// name = "测试角色3",
|
||||||
job = 0,
|
// job = 0,
|
||||||
equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
|
// equip = [101020026, 601500058, 601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021, 609590003]
|
||||||
}, {
|
// }, {
|
||||||
lv = 90,
|
// lv = 90,
|
||||||
name = "测试角色",
|
// name = "测试角色4",
|
||||||
job = 0,
|
// job = 0,
|
||||||
equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
|
// equip = [101020037, 601500061, 601550061, 601560059, 601570054, 601520053, 601500061, 601510060, 601530052, 601540061, 601580024, 609590003]
|
||||||
}, {
|
// }, {
|
||||||
lv = 90,
|
// lv = 90,
|
||||||
name = "测试角色2号",
|
// name = "测试角色5",
|
||||||
job = 0,
|
// job = 0,
|
||||||
equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
// equip = [601020007, 601500060, 601550060, 601560058, 601570053, 601520052, 601500060, 601510059, 601530051, 601540060, 601580023, 609590003]
|
||||||
}]
|
// }]
|
||||||
};
|
// };
|
||||||
Window.Init(T);
|
// Window.Init(T);
|
||||||
|
|
||||||
// local Actorobj = Actor();
|
// local Actorobj = Actor();
|
||||||
// Actorobj.ShowBorder(true);
|
// Actorobj.ShowBorder(true);
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ class _Select_Character_Chr extends Yosin_CommonUi {
|
||||||
Charc.SetAnimation("RestAni");
|
Charc.SetAnimation("RestAni");
|
||||||
Charc.SetPosition(64, 156, 0);
|
Charc.SetPosition(64, 156, 0);
|
||||||
Charc.SetName(Info.lv + "级 " + Info.name);
|
Charc.SetName(Info.lv + "级 " + Info.name);
|
||||||
Charc.AnimationManager.Name.MoveBy(21 - Charc.AnimationManager.Name.GetSize().w / 2, 180);
|
Charc.AnimationManager.Name.MoveBy(0, 180);
|
||||||
Addchild(Charc);
|
Addchild(Charc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -900,3 +900,13 @@ class _create_Character_enterName extends Yosin_Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,11 @@
|
||||||
|
|
||||||
class _Top_tool extends Yosin_Window {
|
class _Top_tool extends Yosin_Window {
|
||||||
|
|
||||||
|
//是否为独立窗口
|
||||||
|
IsIndependent = false;
|
||||||
|
|
||||||
timeTextActor = null;
|
timeTextActor = null;
|
||||||
|
|
||||||
//是否可见
|
|
||||||
// Visible = false;
|
|
||||||
|
|
||||||
//是否为顶层窗口
|
|
||||||
// IsTop = true;
|
|
||||||
|
|
||||||
//窗口位置
|
|
||||||
WindowPos = null;
|
|
||||||
WindowMoveFlag = false;
|
|
||||||
BaseCursorWPos = 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);
|
||||||
|
|
||||||
|
|
@ -27,8 +19,6 @@ class _Top_tool extends Yosin_Window {
|
||||||
RegisterDraw();
|
RegisterDraw();
|
||||||
//注册控件
|
//注册控件
|
||||||
RegisterWidget();
|
RegisterWidget();
|
||||||
|
|
||||||
WindowPos = Sq_GetWindowRect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function RegisterWidget() {
|
function RegisterWidget() {
|
||||||
|
|
@ -53,21 +43,12 @@ class _Top_tool extends Yosin_Window {
|
||||||
|
|
||||||
// 最小化
|
// 最小化
|
||||||
local minButton = _Top_tool_Button(576, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 618);
|
local minButton = _Top_tool_Button(576, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 618);
|
||||||
minButton.OnClick = function(Button) {
|
|
||||||
Sq_ShowWindow(6);
|
|
||||||
}.bindenv(this);
|
|
||||||
AddUIChild(minButton);
|
AddUIChild(minButton);
|
||||||
// 最大化
|
// 最大化
|
||||||
local maxButton = _Top_tool_Button(598, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 628);
|
local maxButton = _Top_tool_Button(598, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 628);
|
||||||
maxButton.OnClick = function(Button) {
|
|
||||||
Sq_ShowWindow(3);
|
|
||||||
}.bindenv(this);
|
|
||||||
AddUIChild(maxButton);
|
AddUIChild(maxButton);
|
||||||
// 关闭
|
// 关闭
|
||||||
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
|
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
|
||||||
closeButton.OnClick = function(Button) {
|
|
||||||
Sq_CloseWindow();
|
|
||||||
}.bindenv(this);
|
|
||||||
AddUIChild(closeButton);
|
AddUIChild(closeButton);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -98,66 +79,8 @@ class _Top_tool extends Yosin_Window {
|
||||||
timeTextActor.SetText(getTimeString());
|
timeTextActor.SetText(getTimeString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果事件在窗口内
|
|
||||||
if (Math.IsIntersectRect(Yosin_Cursor.X, Yosin_Cursor.Y, 1, 1, X, Y, Width, Height)) {
|
|
||||||
if (!Visible) ResetFocus();
|
|
||||||
} else {
|
|
||||||
Visible = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//override
|
|
||||||
//鼠标事件回调
|
|
||||||
function OnMouseProc(MousePos_X, MousePos_Y) {
|
|
||||||
base.OnMouseProc(MousePos_X, MousePos_Y);
|
|
||||||
|
|
||||||
//设定拖动逻辑
|
|
||||||
if (WindowMoveFlag) {
|
|
||||||
local pos = Sq_GetCursorPos();
|
|
||||||
|
|
||||||
local WX = pos.x - M_Xpos;
|
|
||||||
local WY = pos.y - M_Ypos;
|
|
||||||
|
|
||||||
M_Xpos = pos.x;
|
|
||||||
M_Ypos = pos.y;
|
|
||||||
|
|
||||||
WindowPos.left += WX;
|
|
||||||
WindowPos.top += WY;
|
|
||||||
Sq_SetCursorPos(WindowPos.left + BaseCursorWPos.x, WindowPos.top + BaseCursorWPos.y);
|
|
||||||
Sq_SetWindowPos(WindowPos.left, WindowPos.top);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//override
|
|
||||||
//鼠标左键单击回调
|
|
||||||
function OnMouseLbDown(MousePos_X, MousePos_Y) {
|
|
||||||
base.OnMouseLbDown(MousePos_X, MousePos_Y);
|
|
||||||
//如果点击事件在窗口内
|
|
||||||
if (Math.IsIntersectRect(Yosin_Cursor.X, Yosin_Cursor.Y, 1, 1, X, Y, Width, Height)) {
|
|
||||||
WindowMoveFlag = true;
|
|
||||||
local pos = Sq_GetCursorPos();
|
|
||||||
M_Xpos = pos.x; //原始鼠标位置数据
|
|
||||||
M_Ypos = pos.y;
|
|
||||||
BaseCursorWPos = {
|
|
||||||
x = MousePos_X,
|
|
||||||
y = MousePos_Y
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//override
|
|
||||||
//鼠标左键弹起回调
|
|
||||||
function OnMouseLbUp(MousePos_X, MousePos_Y) {
|
|
||||||
//调用原生方法
|
|
||||||
base.OnMouseLbUp(MousePos_X, MousePos_Y);
|
|
||||||
if (WindowMoveFlag) {
|
|
||||||
WindowMoveFlag = false;
|
|
||||||
M_Xpos = null;
|
|
||||||
M_Ypos = null;
|
|
||||||
BaseCursorWPos = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -180,3 +103,6 @@ class _Top_tool_Button extends Yosin_BaseButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
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];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue