1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
local MAP_AREA_MIN_SIZE = 1080
local MAP_AREA_MAX_SIZE = 1920
local MAP_AREA_TEXTURE_SIZE = 2048
local MAP_AREA_MIN_SIZE_PERCENT_OF_TEXTURE_SIZE = MAP_AREA_MIN_SIZE / MAP_AREA_TEXTURE_SIZE
local MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE = MAP_AREA_MAX_SIZE / MAP_AREA_TEXTURE_SIZE
local MAP_AREA_DEPTH = 0
local MAP_AREA_ASPECT_RATIO = 1
local DEPTH_EPSILON = 0.001
local MAP_DEPTH = MAP_AREA_DEPTH
local LINES_DEPTH = - 0.2
local RINGS_DEPTH = LINES_DEPTH - DEPTH_EPSILON
local CONSTELLATIONS_DEPTH = - 0.45
local DAEDRIC_TEXT_DEPTH = - 0.65
local COLD_HARBOR_DEPTH = DAEDRIC_TEXT_DEPTH - DEPTH_EPSILON
ZO_PREGAME_ANIMATED_BACKGROUND_MAP_FADE_DURATION_MS = 500
ZO_PREGAME_ANIMATED_BACKGROUND_LINES_FADE_DELAY_MS = 150
ZO_PREGAME_ANIMATED_BACKGROUND_LINES_FADE_DURATION_MS = 500
ZO_PREGAME_ANIMATED_BACKGROUND_RINGS_FADE_DELAY_MS = 300
ZO_PREGAME_ANIMATED_BACKGROUND_RINGS_FADE_DURATION_MS = 500
ZO_PREGAME_ANIMATED_BACKGROUND_CONSTELLATIONS_FADE_DELAY_MS = 450
ZO_PREGAME_ANIMATED_BACKGROUND_CONSTELLATIONS_FADE_DURATION_MS = 500
ZO_PREGAME_ANIMATED_BACKGROUND_DAEDRIC_TEXT_FADE_DELAY_MS = 600
ZO_PREGAME_ANIMATED_BACKGROUND_DAEDRIC_TEXT_FADE_DURATION_MS = 500
ZO_PREGAME_ANIMATED_BACKGROUND_COLD_HARBOR_FADE_DELAY_MS = 750
ZO_PREGAME_ANIMATED_BACKGROUND_COLD_HARBOR_FADE_DURATION_MS = 500
return obj
end
if newState == SCENE_SHOWING then
elseif newState == SCENE_HIDDEN then
end
end )
end
self . fadeTimeline = ANIMATION_MANAGER : CreateTimelineFromVirtual ( "ZO_PregameAnimatedBackgroundFadeAnimation" )
end
self . coldHarborNode : SetRotation ( math . rad ( 30 ) - zo_random ( ) * math . rad ( 60 ) + math . pi * ( zo_random ( 2 ) - 1 ) )
end
local cameraZ = 0
local mapAreaSize = 0
if canvasHeight > 0 then
local canvasAspectRatio = canvasWidth / canvasHeight
if canvasAspectRatio > MAP_AREA_ASPECT_RATIO then
--If there is extra width space then start with making the map area as tall as possible (right up the the edge of the min size that has to
--be on screen). This will cover the most width.
local heightPercentOfImage = MAP_AREA_MIN_SIZE_PERCENT_OF_TEXTURE_SIZE
local widthPercentOfImage = heightPercentOfImage * canvasAspectRatio
--If the percentage of the map area that would be shown width wise is still larger than what's allowed
if widthPercentOfImage > MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE then
--Then size the map area to the width of the screen and compute the height from that (this will clip more into the min
--area than desired but it can't be helped since we need to maintain the aspect ratio).
widthPercentOfImage = MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE
heightPercentOfImage = widthPercentOfImage / canvasAspectRatio
end
mapAreaSize = canvasHeight / heightPercentOfImage
else
--same algorithm but for extra height space
local widthPercentOfImage = MAP_AREA_MIN_SIZE_PERCENT_OF_TEXTURE_SIZE
local heightPercentOfImage = widthPercentOfImage / canvasAspectRatio
if heightPercentOfImage > MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE then
heightPercentOfImage = MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE
widthPercentOfImage = heightPercentOfImage * canvasAspectRatio
end
mapAreaSize = canvasWidth / widthPercentOfImage
end
end
--The ratio of the final map area to the reference size is used as a scale factor. The size of every other node is done in reference to the MAP_AREA_TEXTURE_SIZE
local magnification = mapAreaSize / MAP_AREA_TEXTURE_SIZE
self . mapTexture : SetDimensions ( self . mapNode : ComputeSizeForDepth ( MAP_AREA_TEXTURE_SIZE * magnification , MAP_AREA_TEXTURE_SIZE * magnification , MAP_DEPTH ) )
self . linesTexture : SetDimensions ( self . linesNode : ComputeSizeForDepth ( 2448 * magnification , 2448 * magnification , LINES_DEPTH ) )
self . rings1Texture : SetDimensions ( self . rings1Node : ComputeSizeForDepth ( 2048 * magnification , 2048 * magnification , RINGS_DEPTH ) )
self . rings2Texture : SetDimensions ( self . rings2Node : ComputeSizeForDepth ( 2048 * magnification , 2048 * magnification , RINGS_DEPTH ) )
self . daedricTextTexture : SetDimensions ( self . daedricTextNode : ComputeSizeForDepth ( 2048 * magnification , 2048 * magnification , DAEDRIC_TEXT_DEPTH ) )
self . constellationsTexture : SetDimensions ( self . constellationsNode : ComputeSizeForDepth ( 2348 * magnification , 2348 * magnification , CONSTELLATIONS_DEPTH ) )
self . coldHarborTexture : SetDimensions ( self . coldHarborIslandNode : ComputeSizeForDepth ( 512 * magnification , 512 * magnification , COLD_HARBOR_DEPTH ) )
end
end
end
--Events
end
end
end
--Global XML Handlers
end |