Advertisement
Guest User

Untitled

a guest
May 11th, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.08 KB | None | 0 0
  1. // COMMENTS!
  2. /*
  3. MULTI
  4. LINE
  5. COMMENTS!
  6. */
  7. fonts:{ //load fonts, so they are just loaded once
  8. button-font:{ //load font and set the name "button-font", with which it can then be used
  9. file: "ComicSans.ttf"
  10. }
  11. }
  12. variables:{
  13. scene: "gray_background" //set variable "scene"
  14. }
  15. elementTemplates:{
  16. jns47-tooltip:{
  17. variables:[ { name: "content", type: "string"}, {name: "name", type: "string"} ]
  18. div:{
  19. name: "jns47-tooltip_border_" + $name //variable name
  20. pos:{ x: cursor.x, y: cursor.y} //cursor.x, cusror.y = variable with cursor position
  21. size:{ width: children[0].size.width + 8px, height: children[0].size.height + 8px} //will go deeper in defintion and use the children size (if there's no absolute value coming, defines it with 0px, 0px)
  22. background:{ color: #909090 }
  23. content:{
  24. div:{
  25. name: "jns47-tooltip_main_" + $name
  26. pos:{ x: 4px, y: 4px} //border of 4 px
  27. size:{ width: children[0].size.width, height: children[0].size.height}
  28. background:{ color: #ffffff }
  29. content:{
  30. text{
  31. name: "jns47-tooltip_text_" + $name
  32. content: $content // variable content
  33. color: #101010
  34. align:{ x: center, y: center }
  35. pos:{ x: 0, y: 0 }
  36. font:{
  37. name: "button-font"
  38. charSize:{ width: 30px, height: auto } //width fixed, height auto - to fit width of one char
  39. }
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. classStyles:{
  48. button:{
  49. definitions:{
  50. pos:{ x: 0, y: 6.25%}
  51. size:{ width: 70%, height: 6.25%}
  52. background:{ color: #909090 }
  53. focusable: true //if there is no focusable line, it's false
  54. content.text{ //all texts inside a element with the class get this style
  55. color: #101010
  56. align:{ x: left, y: center }
  57. pos:{ x: 12%, y: 0 } //12% from left, 0 from center
  58. font:{
  59. name: "button-font"
  60. charSize:{ width: 3%, height: 80% }
  61. }
  62. }
  63. }
  64. }
  65. }
  66. ui:{
  67. name: "main_menu" //name = ID
  68. div:{
  69. name: "background"
  70. pos:{ x: 0, y: 0 } //comma if multiple values in one line
  71. size:{
  72. width: 100vw //optional comma if one value per line (auto-comma at end of the line if you don't have one)
  73. height: 100vh
  74. }
  75. background:{ color: #a0a0a0 }
  76. content:{
  77. div:{
  78. name: "logo-wrapper"
  79. // x = 0, y = 0 is start of the container, for position based on the screen use vw and vh
  80. pos:{ x: 0, y: 0 } //comma if multiple values in one line
  81. size:{ width: 100%, height: 12% }
  82. background:{ color: #ffffff }
  83. content:{
  84. rectangle:{ //rectangle has position and size
  85. name: "logo"
  86. pos:{ x: 2%, y: 2% }
  87. size:{ width: 20%, height: 96% }
  88. draw:{
  89. image:{ //draw the image on the rectangle
  90. file: "/assets/logo.tga"
  91. position:{
  92. x: start
  93. y: center
  94. }
  95. size: contain
  96. }
  97. }
  98. }
  99. }
  100. }
  101. div:{
  102. name: "main"
  103. pos:{ x: 0, y: 12% }
  104. size:{ width: 100%, height: 88% }
  105. background:{
  106. bikeView:{
  107. scene: $scene //map, uses variable "scene"
  108. pose: "bike_stand" //rider and bike pose
  109.  
  110. showBike: true
  111. bike: bike_current //bike_current = variable
  112. bikeDirtLevel: 0
  113.  
  114. showRider: true
  115. rider:{ //possible to use rider_current instead
  116. Helmet: rider_current.helmet //includes goggles and helmet cam
  117. kit:{
  118. manufacturer: "Alpinestars"
  119. model: "Racer Supermatic"
  120. color: "Black White"
  121. }
  122. gloves: rider_current.gloves
  123. boots: rider_current.boots
  124. protection: rider_current.protection
  125. }
  126.  
  127. camera:{
  128. position: position3D(50, 10, 100) //x, y, z
  129. angle: angle3D(0, 12, 0) // rotation horizontal, rotation vertical, rotation camera? (upside-down view for example)
  130. fov: 100
  131. }
  132. }
  133. }
  134. content:{
  135. div:{
  136. name: "sidebar-wrapper"
  137. pos:{ x: 0, y: 0 }
  138. size:{ width: 25%, height: 88% }
  139. background:{ color: transparent }
  140. content:{
  141. polygon:{ //polygon has just points
  142. name: sidebar
  143. points:[ //array
  144. { x: 0, y: 0 }
  145. { x: 100%, y: 0 }
  146. { x: 0, y: 100% }
  147. { x: 80%, y: 100% }
  148. ]
  149. draw:{
  150. color: #ffffff
  151. }
  152. }
  153. div:{ //getting drawn over the polygon because it's drawn top-to-bottom
  154. name: "testing_btn"
  155. classes: ["button"]
  156. pos:{ x: 0, y: 6.25%} //overwrites class position
  157. events:{
  158. onHover:{
  159. children[0].draw.color = #000000; //change first children (polygon) color to black
  160. playSound("hover.wav");
  161. }
  162. onClick:{
  163. children[0].draw.color = #ff0000; //change first children (polygon) color to red
  164. playSound("click.wav");
  165. openUI("testing_menu");
  166. }
  167. }
  168. content:{
  169. polygon:{
  170. name: "testing_plgn"
  171. points:[
  172. { x: 0, y: 0 }
  173. { x: 10%, y: 0 }
  174. { x: 0, y: 100% }
  175. { x: 5%, y: 100% }
  176. ]
  177. draw:{
  178. color: #707070
  179. }
  180. }
  181. text:{
  182. name: "testing_txt"
  183. content: languageText("testing.title", language_current) // languageText = function, returns text with ID "testing.title" in the language language_current, language_current = variable
  184. }
  185. jns47-tooltip:{ //custom defined element with just two variables, "content" and "name"
  186. name: "testing_tltp"
  187. content: languageText("testing.tooltip", language_current)
  188. }
  189. }
  190. }
  191. div:{
  192. name: "race_btn"
  193. classes: ["button"]
  194. events:{
  195. onHover:{
  196. children[0].draw.color = #000000;
  197. playSound("hover.wav");
  198. }
  199. onClick:{
  200. children[0].draw.color = #ff0000;
  201. playSound("click.wav");
  202. openUI("race_menu");
  203. }
  204. }
  205. content:{
  206. polygon:{
  207. name: "race_plgn"
  208. points:[
  209. { x: 0, y: 0 }
  210. { x: 10%, y: 0 }
  211. { x: 0, y: 100% }
  212. { x: 5%, y: 100% }
  213. ]
  214. draw:{
  215. color: #707070
  216. }
  217. }
  218. text:{
  219. name: "race_txt"
  220. content: languageText("race.title", language_current)
  221. color(connection.isEstablished == true): #600000 //makes no sense, but it's just and example for conditional style
  222. }
  223. jns47-tooltip:{
  224. name: "race_tltp"
  225. content: languageText("race.tooltip", language_current)
  226. }
  227. }
  228. }
  229. div:{
  230. name: "bike_btn"
  231. classes: ["button"]
  232. events:{
  233. onHover:{
  234. children[0].draw.color = #000000;
  235. playSound("hover.wav");
  236. }
  237. onClick:{
  238. children[0].draw.color = #ff0000;
  239. playSound("click.wav");
  240. openUI("bike_menu");
  241. }
  242. }
  243. content:{
  244. polygon:{
  245. name: "bike_plgn"
  246. points:[
  247. { x: 0, y: 0 }
  248. { x: 10%, y: 0 }
  249. { x: 0, y: 100% }
  250. { x: 5%, y: 100% }
  251. ]
  252. draw:{
  253. color: #707070
  254. }
  255. }
  256. text:{
  257. name: "bike_txt"
  258. content: languageText("bike.title", language_current)
  259. }
  260. jns47-tooltip:{
  261. name: "bike_tltp"
  262. content: languageText("bike.tooltip", language_current)
  263. }
  264. }
  265. }
  266. div:{
  267. name: "replays_btn"
  268. classes: ["button"]
  269. events:{
  270. onHover:{
  271. children[0].draw.color = #000000;
  272. playSound("hover.wav");
  273. }
  274. onClick:{
  275. children[0].draw.color = #ff0000;
  276. playSound("click.wav");
  277. openUI("replays_menu");
  278. }
  279. }
  280. content:{
  281. polygon:{
  282. name: "replays_plgn"
  283. points:[
  284. { x: 0, y: 0 }
  285. { x: 10%, y: 0 }
  286. { x: 0, y: 100% }
  287. { x: 5%, y: 100% }
  288. ]
  289. draw:{
  290. color: #707070
  291. }
  292. }
  293. text:{
  294. name: "replays_txt"
  295. content: languageText("replays.title", language_current)
  296. }
  297. jns47-tooltip:{
  298. name: "replays_tltp"
  299. content: languageText("replays.tooltip", language_current)
  300. }
  301. }
  302. }
  303. div:{
  304. name: "best_laps_btn"
  305. classes: ["button"]
  306. events:{
  307. onHover:{
  308. children[0].draw.color = #000000;
  309. playSound("hover.wav");
  310. }
  311. onClick:{
  312. children[0].draw.color = #ff0000;
  313. playSound("click.wav");
  314. openUI("best_laps_menu");
  315. }
  316. }
  317. content:{
  318. polygon:{
  319. name: "best_laps_plgn"
  320. points:[
  321. { x: 0, y: 0 }
  322. { x: 10%, y: 0 }
  323. { x: 0, y: 100% }
  324. { x: 5%, y: 100% }
  325. ]
  326. draw:{
  327. color: #707070
  328. }
  329. }
  330. text:{
  331. name: "best_laps_txt"
  332. content: languageText("best_laps.title", language_current)
  333. }
  334. jns47-tooltip:{
  335. name: "best_laps_tltp"
  336. content: languageText("best_laps.tooltip", language_current)
  337. }
  338. }
  339. }
  340. div:{
  341. name: "profile_btn"
  342. classes: ["button"]
  343. events:{
  344. onHover:{
  345. children[0].draw.color = #000000;
  346. playSound("hover.wav");
  347. }
  348. onClick:{
  349. children[0].draw.color = #ff0000;
  350. playSound("click.wav");
  351. openUI("profile_menu");
  352. }
  353. }
  354. content:{
  355. polygon:{
  356. name: "profile_plgn"
  357. points:[
  358. { x: 0, y: 0 }
  359. { x: 10%, y: 0 }
  360. { x: 0, y: 100% }
  361. { x: 5%, y: 100% }
  362. ]
  363. draw:{
  364. color: #707070
  365. }
  366. }
  367. text:{
  368. name: "profile_txt"
  369. content: languageText("profile.title", language_current)
  370. }
  371. jns47-tooltip:{
  372. name: "profile_tltp"
  373. content: languageText("profile.tooltip", language_current)
  374. }
  375. }
  376. }
  377. div:{
  378. name: "settings_btn"
  379. classes: ["button"]
  380. events:{
  381. onHover:{
  382. children[0].draw.color = #000000;
  383. playSound("hover.wav");
  384. }
  385. onClick:{
  386. children[0].draw.color = #ff0000;
  387. playSound("click.wav");
  388. openUI("settings_menu");
  389. }
  390. }
  391. content:{
  392. polygon:{
  393. name: "settings_plgn"
  394. points:[
  395. { x: 0, y: 0 }
  396. { x: 10%, y: 0 }
  397. { x: 0, y: 100% }
  398. { x: 5%, y: 100% }
  399. ]
  400. draw:{
  401. color: #707070
  402. }
  403. }
  404. text:{
  405. name: "settings_txt"
  406. content: languageText("settings.title", language_current)
  407. }
  408. jns47-tooltip:{
  409. name: "settings_tltp"
  410. content: languageText("settings.tooltip", language_current)
  411. }
  412. }
  413. }
  414. div:{
  415. name: "inspect_bike_btn"
  416. classes: ["button"]
  417. events:{
  418. onHover:{
  419. children[0].draw.color = #000000;
  420. playSound("hover.wav");
  421. }
  422. onClick:{
  423. children[0].draw.color = #ff0000;
  424. playSound("click.wav");
  425. openUI("inspect_bike_menu");
  426. }
  427. }
  428. content:{
  429. polygon:{
  430. name: "inspect_bike_plgn"
  431. points:[
  432. { x: 0, y: 0 }
  433. { x: 10%, y: 0 }
  434. { x: 0, y: 100% }
  435. { x: 5%, y: 100% }
  436. ]
  437. draw:{
  438. color: #707070
  439. }
  440. }
  441. text:{
  442. name: "inspect_bike_txt"
  443. content: languageText("inspect_bike.title", language_current)
  444. }
  445. jns47-tooltip:{
  446. name: "inspect_bike_tltp"
  447. content: languageText("inspect_bike.tooltip", language_current)
  448. }
  449. }
  450. }
  451. div:{
  452. name: "exit_btn"
  453. classes: ["button"]
  454. events:{
  455. onHover:{
  456. children[0].draw.color = #000000;
  457. playSound("hover.wav");
  458. }
  459. onClick:{
  460. children[0].draw.color = #ff0000;
  461. playSound("click.wav");
  462. openUI("exit_box");
  463. }
  464. }
  465. content:{
  466. polygon:{
  467. name: "exit_plgn"
  468. points:[
  469. { x: 0, y: 0 }
  470. { x: 10%, y: 0 }
  471. { x: 0, y: 100% }
  472. { x: 5%, y: 100% }
  473. ]
  474. draw:{
  475. color: #707070
  476. }
  477. }
  478. text:{
  479. name: "exit_txt"
  480. content: languageText("exit.title", language_current)
  481. }
  482. jns47-tooltip:{
  483. name: "exit_tltp"
  484. content: languageText("exit.tooltip", language_current)
  485. }
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement