mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
Android fly - Use new asset and screen position
This commit is contained in:
parent
88c83f3bfe
commit
ffb8b0a60e
5 changed files with 9 additions and 7 deletions
BIN
interface/resources/images/fly.png
Normal file
BIN
interface/resources/images/fly.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -71,13 +71,14 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
}
|
||||
|
||||
_virtualPadJumpBtnPixelSize = dpi * VirtualPad::Manager::JUMP_BTN_FULL_PIXELS / VirtualPad::Manager::DPI;
|
||||
iconPath = PathUtils::resourcesPath() + "images/analog_stick.png";
|
||||
iconPath = PathUtils::resourcesPath() + "images/fly.png";
|
||||
image = QImage(iconPath);
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
if ((image.width() > 0) && (image.height() > 0)) {
|
||||
image = image.scaled(_virtualPadJumpBtnPixelSize, _virtualPadJumpBtnPixelSize, Qt::KeepAspectRatio);
|
||||
image = image.mirrored();
|
||||
|
||||
_virtualPadJumpBtnTexture = gpu::Texture::createStrict(
|
||||
gpu::Element(gpu::VEC4, gpu::NUINT8, gpu::RGBA),
|
||||
|
|
|
@ -132,8 +132,7 @@ protected:
|
|||
void jumpTouchEnd();
|
||||
bool jumpTouchBeginIsValid(glm::vec2 touchPoint);
|
||||
|
||||
void setupFixedCenter(VirtualPad::Manager& virtualPadManager, bool force = false);
|
||||
void setupJumpButton(VirtualPad::Manager& virtualPadManager);
|
||||
void setupControlsPositions(VirtualPad::Manager& virtualPadManager, bool force = false);
|
||||
|
||||
void processInputDeviceForMove(VirtualPad::Manager& virtualPadManager);
|
||||
glm::vec2 clippedPointInCircle(float radius, glm::vec2 origin, glm::vec2 touchPoint);
|
||||
|
|
|
@ -38,9 +38,10 @@ namespace VirtualPad {
|
|||
const float Manager::BASE_DIAMETER_PIXELS = 512.0f;
|
||||
const float Manager::BASE_MARGIN_PIXELS = 59.0f;
|
||||
const float Manager::STICK_RADIUS_PIXELS = 105.0f;
|
||||
const float Manager::JUMP_BTN_TOP_MARGIN_PIXELS = 59.0f;
|
||||
const float Manager::JUMP_BTN_TRIMMED_RADIUS_PIXELS = 105.0f;
|
||||
const float Manager::JUMP_BTN_FULL_PIXELS = 512.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_BOTTOM_MARGIN_PIXELS = 67.0f;
|
||||
const float Manager::JUMP_BTN_LEFT_MARGIN_PIXELS = 547.0f;
|
||||
|
||||
Manager::Manager() {
|
||||
|
||||
|
|
|
@ -51,9 +51,10 @@ namespace VirtualPad {
|
|||
static const float BASE_DIAMETER_PIXELS;
|
||||
static const float BASE_MARGIN_PIXELS;
|
||||
static const float STICK_RADIUS_PIXELS;
|
||||
static const float JUMP_BTN_TOP_MARGIN_PIXELS;
|
||||
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;
|
||||
|
||||
private:
|
||||
Instance _leftVPadInstance;
|
||||
|
|
Loading…
Reference in a new issue