Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/pregame/mainmenu.js
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | function scrollBackgrounds() | ||||
{ | { | ||||
let guiObj = Engine.GetGUIObjectByName("background[" + i + "]"); | let guiObj = Engine.GetGUIObjectByName("background[" + i + "]"); | ||||
let screen = guiObj.parent.getComputedSize(); | let screen = guiObj.parent.getComputedSize(); | ||||
let h = screen.bottom - screen.top; | let h = screen.bottom - screen.top; | ||||
let w = h * 16/9; | let w = h * 16/9; | ||||
let iw = h * 2; | let iw = h * 2; | ||||
if (!g_BackgroundLayerset[i].offset) | |||||
{ | |||||
guiObj.size = new GUISize(screen.left, screen.top, screen.right, screen.bottom); | |||||
continue; | |||||
} | |||||
let offset = g_BackgroundLayerset[i].offset((Date.now() - g_T0) / 1000, w); | let offset = g_BackgroundLayerset[i].offset((Date.now() - g_T0) / 1000, w); | ||||
if (g_BackgroundLayerset[i].tiling) | if (g_BackgroundLayerset[i].tiling) | ||||
{ | { | ||||
let left = offset % iw; | let left = offset % iw; | ||||
if (left >= 0) | if (left >= 0) | ||||
left -= iw; | left -= iw; | ||||
guiObj.size = new GUISize(left, screen.top, screen.right, screen.bottom); | guiObj.size = new GUISize(left, screen.top, screen.right, screen.bottom); | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator