mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 10:24:01 +02:00
adding scale to notifications
This commit is contained in:
parent
fec8482b69
commit
a34dae4aad
1 changed files with 8 additions and 7 deletions
|
@ -207,7 +207,7 @@
|
||||||
notificationOrientation,
|
notificationOrientation,
|
||||||
notificationPosition,
|
notificationPosition,
|
||||||
buttonPosition;
|
buttonPosition;
|
||||||
|
var sensorScaleFactor = MyAvatar.sensorToWorldScale;
|
||||||
// Notification plane positions
|
// Notification plane positions
|
||||||
noticeY = -y * NOTIFICATION_3D_SCALE - noticeHeight / 2;
|
noticeY = -y * NOTIFICATION_3D_SCALE - noticeHeight / 2;
|
||||||
notificationPosition = { x: 0, y: noticeY, z: 0 };
|
notificationPosition = { x: 0, y: noticeY, z: 0 };
|
||||||
|
@ -221,8 +221,8 @@
|
||||||
|
|
||||||
// Translate plane
|
// Translate plane
|
||||||
originOffset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, NOTIFICATIONS_3D_DIRECTION, 0),
|
originOffset = Vec3.multiplyQbyV(Quat.fromPitchYawRollDegrees(0, NOTIFICATIONS_3D_DIRECTION, 0),
|
||||||
{ x: 0, y: 0, z: -NOTIFICATIONS_3D_DISTANCE });
|
{ x: 0, y: 0, z: -NOTIFICATIONS_3D_DISTANCE * sensorScaleFactor});
|
||||||
originOffset.y += NOTIFICATIONS_3D_ELEVATION;
|
originOffset.y += NOTIFICATIONS_3D_ELEVATION * sensorScaleFactor;
|
||||||
notificationPosition = Vec3.sum(originOffset, notificationPosition);
|
notificationPosition = Vec3.sum(originOffset, notificationPosition);
|
||||||
buttonPosition = Vec3.sum(originOffset, buttonPosition);
|
buttonPosition = Vec3.sum(originOffset, buttonPosition);
|
||||||
|
|
||||||
|
@ -242,14 +242,14 @@
|
||||||
noticeHeight,
|
noticeHeight,
|
||||||
positions,
|
positions,
|
||||||
last;
|
last;
|
||||||
|
var sensorScaleFactor = MyAvatar.sensorToWorldScale;
|
||||||
if (isOnHMD) {
|
if (isOnHMD) {
|
||||||
// Calculate 3D values from 2D overlay properties.
|
// Calculate 3D values from 2D overlay properties.
|
||||||
|
|
||||||
noticeWidth = notice.width * NOTIFICATION_3D_SCALE + NOTIFICATION_3D_BUTTON_WIDTH;
|
noticeWidth = notice.width * NOTIFICATION_3D_SCALE + NOTIFICATION_3D_BUTTON_WIDTH;
|
||||||
noticeHeight = notice.height * NOTIFICATION_3D_SCALE;
|
noticeHeight = notice.height * NOTIFICATION_3D_SCALE;
|
||||||
|
|
||||||
notice.size = { x: noticeWidth, y: noticeHeight };
|
notice.size = { x: noticeWidth, y: noticeHeight};
|
||||||
|
|
||||||
positions = calculate3DOverlayPositions(noticeWidth, noticeHeight, notice.y);
|
positions = calculate3DOverlayPositions(noticeWidth, noticeHeight, notice.y);
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@
|
||||||
notice.leftMargin = 2 * notice.leftMargin * NOTIFICATION_3D_SCALE;
|
notice.leftMargin = 2 * notice.leftMargin * NOTIFICATION_3D_SCALE;
|
||||||
notice.bottomMargin = 0;
|
notice.bottomMargin = 0;
|
||||||
notice.rightMargin = 0;
|
notice.rightMargin = 0;
|
||||||
notice.lineHeight = 10.0 * (fontSize / 12.0) * NOTIFICATION_3D_SCALE;
|
notice.lineHeight = 10.0 * (fontSize * sensorScaleFactor / 12.0) * NOTIFICATION_3D_SCALE;
|
||||||
notice.isFacingAvatar = false;
|
notice.isFacingAvatar = false;
|
||||||
|
|
||||||
notificationText = Overlays.addOverlay("text3d", notice);
|
notificationText = Overlays.addOverlay("text3d", notice);
|
||||||
|
@ -366,6 +366,7 @@
|
||||||
buttonProperties,
|
buttonProperties,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
|
var sensorScaleFactor = MyAvatar.sensorToWorldScale;
|
||||||
if (text.length >= breakPoint) {
|
if (text.length >= breakPoint) {
|
||||||
breaks = count;
|
breaks = count;
|
||||||
}
|
}
|
||||||
|
@ -387,7 +388,7 @@
|
||||||
alpha: backgroundAlpha,
|
alpha: backgroundAlpha,
|
||||||
topMargin: topMargin,
|
topMargin: topMargin,
|
||||||
leftMargin: leftMargin,
|
leftMargin: leftMargin,
|
||||||
font: {size: fontSize},
|
font: {size: fontSize * sensorScaleFactor},
|
||||||
text: text
|
text: text
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue