Move jump button to the right. Adjust position of buttons

This commit is contained in:
Gabriel Calero 2018-04-11 19:33:43 -03:00
parent 8010fd2420
commit 865e3a05f1
7 changed files with 11 additions and 10 deletions

View file

@ -1,6 +1,6 @@
<resources>
<string name="app_name" translatable="false">Interface</string>
<string name="go_to">Go To</string>
<string name="go_to">Home</string>
<string name="web_view_action_open_in_browser" translatable="false">Open in browser</string>
<string name="web_view_action_share" translatable="false">Share link</string>
<string name="web_view_action_share_subject" translatable="false">Shared a link</string>

View file

@ -40,7 +40,7 @@ Item {
Component.onCompleted: {
// put on bottom
x = 50;
x = 30;
y = 0;
width = 300;
height = 300;

View file

@ -40,8 +40,8 @@ Item {
Component.onCompleted: {
// put on bottom
x = parent.width-300;
y = 0;
x = parent.width-315;
y = 5;
width = 300;
height = 300;
}

View file

@ -15,7 +15,7 @@ Item {
Component.onCompleted: {
width = 300; // That 30 is extra regardless the qty of items shown
height = 300;
x=parent.width - 540;
x=parent.width - 555;
}
function addButton(properties) {

View file

@ -80,9 +80,10 @@ void TouchscreenVirtualPadDevice::setupControlsPositions(VirtualPad::Manager& vi
virtualPadManager.getLeftVirtualPad()->setFirstTouch(_moveRefTouchPoint);
// Jump button
float leftMargin = _screenDPI * VirtualPad::Manager::JUMP_BTN_LEFT_MARGIN_PIXELS / VirtualPad::Manager::DPI;
float jumpBtnPixelSize = _screenDPI * VirtualPad::Manager::JUMP_BTN_FULL_PIXELS / VirtualPad::Manager::DPI;
float rightMargin = _screenDPI * VirtualPad::Manager::JUMP_BTN_RIGHT_MARGIN_PIXELS / VirtualPad::Manager::DPI;
float bottomMargin = _screenDPI * VirtualPad::Manager::JUMP_BTN_BOTTOM_MARGIN_PIXELS/ VirtualPad::Manager::DPI;
_jumpButtonPosition = glm::vec2( _jumpButtonRadius + leftMargin, eventScreen->size().height() - bottomMargin - _jumpButtonRadius - _extraBottomMargin);
_jumpButtonPosition = glm::vec2( eventScreen->size().width() - rightMargin - jumpBtnPixelSize, eventScreen->size().height() - bottomMargin - _jumpButtonRadius - _extraBottomMargin);
virtualPadManager.setJumpButtonPosition(_jumpButtonPosition);
}

View file

@ -39,9 +39,9 @@ namespace VirtualPad {
const float Manager::BASE_MARGIN_PIXELS = 59.0f;
const float Manager::STICK_RADIUS_PIXELS = 105.0f;
const float Manager::JUMP_BTN_TRIMMED_RADIUS_PIXELS = 67.0f;
const float Manager::JUMP_BTN_FULL_PIXELS = 134.0f;
const float Manager::JUMP_BTN_FULL_PIXELS = 164.0f;
const float Manager::JUMP_BTN_BOTTOM_MARGIN_PIXELS = 67.0f;
const float Manager::JUMP_BTN_LEFT_MARGIN_PIXELS = 547.0f;
const float Manager::JUMP_BTN_RIGHT_MARGIN_PIXELS = 20.0f;
Manager::Manager() {

View file

@ -54,7 +54,7 @@ namespace VirtualPad {
static const float JUMP_BTN_TRIMMED_RADIUS_PIXELS;
static const float JUMP_BTN_FULL_PIXELS;
static const float JUMP_BTN_BOTTOM_MARGIN_PIXELS;
static const float JUMP_BTN_LEFT_MARGIN_PIXELS;
static const float JUMP_BTN_RIGHT_MARGIN_PIXELS;
private:
Instance _leftVPadInstance;