some new textures + UI test

This commit is contained in:
Alexander Biryukov 2018-04-04 16:44:30 +05:00
parent c97c179199
commit 3fa7602880
12 changed files with 50 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

29
assets/gui_alex.json Executable file
View File

@ -0,0 +1,29 @@
{
"widgets": [{
"type": "FrameLayout",
"name": "levelLayout",
"background": "#00000000",
"width": "match_parent",
"height": "match_parent",
"horizontalAlignment": "HA_CENTER",
"verticalAlignment": "VA_CENTER",
"children": [{
"type": "HorizontalLinearLayout",
"name": "topPannel",
"background": "#000000ff",
"marginBottom": 300,
"width": "wrap_content",
"height": "wrap_content",
"itemSpacing": 1,
"children": [{
"type": "Button",
"name": "backButton",
"width": 60,
"height": 40,
"background": "showBothModesButton_normal.png",
"pressedDrawable": "showBothModesButton_pressed.png",
"hoverDrawable": "showBothModesButton_selected.png"
}]
}]
}]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

BIN
assets/wall_bonus_mod2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
assets/wall_left_mod2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/wall_right_mod2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
assets/wall_up_mod2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -868,12 +868,12 @@ void TGameLevel::Draw()
Renderer->DrawRect(wallUpPos1, wallUpPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallUpPos1, wallUpPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
const Vector2f wallLeftPos1(xlOffset, lrFBO+ylOffset); const Vector2f wallLeftPos1(xlOffset, lrFBO+ylOffset);
const Vector2f wallLeftPos2(lWTW + xlOffset, tSH-ylOffset-uWTW); const Vector2f wallLeftPos2(lWTW + xlOffset, tSH-ylOffset-(uWTW*0.8f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_LEFT_TEXTURE]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_LEFT_TEXTURE]);
Renderer->DrawRect(wallLeftPos1, wallLeftPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallLeftPos1, wallLeftPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));
const Vector2f wallRightPos1(tSW+xlOffset-rWTW, lrFBO+ylOffset); const Vector2f wallRightPos1(tSW+xlOffset-rWTW, lrFBO+ylOffset);
const Vector2f wallRightPos2(tSW + xlOffset, tSH-ylOffset-uWTW); const Vector2f wallRightPos2(tSW + xlOffset, tSH-ylOffset-(uWTW*0.8f));
glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_RIGHT_TEXTURE]); glBindTexture(GL_TEXTURE_2D,ResourceManager->TexList[CONST_WALL_RIGHT_TEXTURE]);
Renderer->DrawRect(wallRightPos1, wallRightPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f)); Renderer->DrawRect(wallRightPos1, wallRightPos2, Vector2f(0.f, 0.f), Vector2f(1.f, 1.f));

View File

@ -33,17 +33,11 @@ const std::string CONST_BALLGLOW_TEXTURE = "ball_glow";
const std::string CONST_REFLECTOR_TEXTURE = "reflector_mod1"; const std::string CONST_REFLECTOR_TEXTURE = "reflector_mod1";
const std::string CONST_WALL_LEFT_TEXTURE = "wall_left_mod1"; const std::string CONST_WALL_LEFT_TEXTURE = "wall_left_mod2";
const std::string CONST_WALL_RIGHT_TEXTURE = "wall_right_mod1"; const std::string CONST_WALL_RIGHT_TEXTURE = "wall_right_mod2";
const std::string CONST_WALL_UP_TEXTURE = "wall_up_mod1"; const std::string CONST_WALL_UP_TEXTURE = "wall_up_mod2";
//const std::string CONST_WALL_BONUS_TEXTURE = "wall_bonus";
/* const std::string CONST_WALL_BONUS_TEXTURE = "wall_bonus_mod2";
const std::string CONST_WALL_LEFT_TEXTURE = "left_frame_fragment";
const std::string CONST_WALL_RIGHT_TEXTURE = "right_frame_fragment";
const std::string CONST_WALL_UP_TEXTURE = "top_frame_fragment";
*/
const std::string CONST_WALL_BONUS_TEXTURE = "bottom_frame_fragment";
const std::string CONST_BACK_BTN_TEXTURE = "back_btn"; const std::string CONST_BACK_BTN_TEXTURE = "back_btn";
const std::string CONST_SLIDE_UP_BTN_TEXTURE = "slide_up_btn"; const std::string CONST_SLIDE_UP_BTN_TEXTURE = "slide_up_btn";
@ -117,7 +111,10 @@ void TMyApplication::InnerInit()
Application->SetGameLevelScreenScale(); Application->SetGameLevelScreenScale();
//GameLevel.SetLevelScale(); //GameLevel.SetLevelScale();
EffectsInit(); EffectsInit();
/*
ResourceManager->newGuiManager.LoadFromConfig("gui_alex.json");
SetButtonsAction();
*/
} }
void TMyApplication::InnerDeinit() void TMyApplication::InnerDeinit()
@ -639,4 +636,13 @@ void TMyApplication::hitSpark(std::string direct,Vector2f Pos) {
void TMyApplication::fireworkEffect() { void TMyApplication::fireworkEffect() {
lvlFirework.stopSpawn(); lvlFirework.stopSpawn();
lvlFirework.startSpawn(); lvlFirework.startSpawn();
}
void TMyApplication::SetButtonsAction () {
auto backBtn = ResourceManager->newGuiManager.findWidgetByName("backButton");
if (backBtn) {
backBtn->onMouseUpSignal.connect([this, backBtn](Vector2f pos, int touchNumber) {
});
}
} }

View File

@ -173,6 +173,8 @@ public:
float GetGameLevelScreenWidth(); float GetGameLevelScreenWidth();
float GetGameLevelScreenHeight(); float GetGameLevelScreenHeight();
void SetGameLevelScreenScale(); void SetGameLevelScreenScale();
void SetButtonsAction();
}; };