|
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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
-- Map and texture sizeslocal MAP_AREA_MIN_SIZE = 1080local MAP_AREA_MAX_SIZE = 1920local MAP_AREA_TEXTURE_SIZE = 2048local MAP_AREA_MIN_SIZE_PERCENT_OF_TEXTURE_SIZE = MAP_AREA_MIN_SIZE / MAP_AREA_TEXTURE_SIZElocal MAP_AREA_MAX_SIZE_PERCENT_OF_TEXTURE_SIZE = MAP_AREA_MAX_SIZE / MAP_AREA_TEXTURE_SIZElocal MAP_AREA_DEPTH = 0local MAP_AREA_ASPECT_RATIO = 1-- Scene graph node depthslocal DEPTH_EPSILON = 0.00001local MAP_DEPTH = MAP_AREA_DEPTHlocal LINES_DEPTH = -0.2local RINGS_DEPTH = LINES_DEPTH - DEPTH_EPSILONlocal CONSTELLATIONS_DEPTH = -0.45local DAEDRIC_TEXT_DEPTH = -0.65local REALM_DEPTH = DAEDRIC_TEXT_DEPTH - DEPTH_EPSILON-- Rotation speeds-- Animation timingZO_ONE_TAMRIEL_BACKGROUND_MAP_FADE_DURATION_MS = 500ZO_ONE_TAMRIEL_BACKGROUND_LINES_FADE_DELAY_MS = 150ZO_ONE_TAMRIEL_BACKGROUND_LINES_FADE_DURATION_MS = 500ZO_ONE_TAMRIEL_BACKGROUND_RINGS_FADE_DELAY_MS = 300ZO_ONE_TAMRIEL_BACKGROUND_RINGS_FADE_DURATION_MS = 500ZO_ONE_TAMRIEL_BACKGROUND_CONSTELLATIONS_FADE_DELAY_MS = 450ZO_ONE_TAMRIEL_BACKGROUND_CONSTELLATIONS_FADE_DURATION_MS = 500ZO_ONE_TAMRIEL_BACKGROUND_DAEDRIC_TEXT_FADE_DELAY_MS = 600ZO_ONE_TAMRIEL_BACKGROUND_DAEDRIC_TEXT_FADE_DURATION_MS = 500 ZO_ONE_TAMRIEL_BACKGROUND_REALM_FADE_DELAY_MS = 750ZO_ONE_TAMRIEL_BACKGROUND_REALM_FADE_DURATION_MS = 500 return objend -- Map Elements -- Realm "Islands" { } end if newState == SCENE_SHOWING then elseif newState == SCENE_HIDDEN then end end) end)end self.fadeTimeline = ANIMATION_MANAGER:CreateTimelineFromVirtual("ZO_OneTamrielBackgroundFadeAnimation") -- Map Elements -- Realm "Islands" local animationIndex = 7 animationIndex = animationIndex + 1 endend -- Map Elements -- Realm "Islands" realmData.graphNode = graphNode -- Rotate the graph node into its assigned position on the ring. realmData.islandGraphNode = islandGraphNode -- Counter the graph node's offset angle to ensure that the island remains upright. endend 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 -- Map Elements 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)) -- Realm "Islands" local realmSize = 384 * magnification local realmOffset = 735 * magnification realmData.control:SetDimensions(realmData.islandGraphNode:ComputeSizeForDepth(realmSize, realmSize, REALM_DEPTH)) endend endendend-- Events -- Map Elements -- Realm "Islands" local realmRotationRadians = deltaS * RINGS_ROTATION_RADIANS_PER_S -- Counter the graph node rotation to keep the realm upright. endendend-- Global XML Handlersend |