A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

59 行
1.5KB

  1. import Utils from "/app/js/common/Utils.js";
  2. import GlobalEvents from "/app/js/common/EventCaller.js";
  3. import EmitterElements from "/app/js/ui/Emitters.js";
  4. import Input from "/app/js/ui/Input.js";
  5. import Modal from "/app/js/ui/Modal.js";
  6. import Tabs from "/app/js/ui/Tabs.js";
  7. import CTRLPalettes from "/app/js/ctrls/CTRLPalettes.js";
  8. import CTRLPainter from "/app/js/ctrls/CTRLPainter.js";
  9. import CTRLBankTools from "/app/js/ctrls/CTRLBankTools.js";
  10. import CTRLIO from "/app/js/ctrls/CTRLIO.js";
  11. import NESPalette from "/app/js/models/NESPalette.js";
  12. function TitlePainter(pal){
  13. var elist = document.querySelectorAll(".color-NES-random");
  14. if (elist){
  15. elist.forEach(function(el){
  16. var ca = Math.floor(Math.random() * 11) + 1;
  17. var cb = Math.floor(Math.random() * 3);
  18. var index = (cb*16)+ca;
  19. el.style.color = pal[index];
  20. //el.style["background-color"] = "#000";
  21. });
  22. }
  23. }
  24. function initialize(DOC){
  25. // UI and View only controllers
  26. TitlePainter(NESPalette.SystemColor);
  27. EmitterElements.initialize();
  28. Tabs.initialize();
  29. // Controllers explicitly interface model data to view.
  30. CTRLPainter.initialize();
  31. CTRLBankTools.initialize();
  32. CTRLIO.initialize();
  33. var cover = document.querySelector(".cover");
  34. Utils.addListenerToEvents(
  35. cover,
  36. [
  37. "webkitAnimationEnd",
  38. "oanimationend",
  39. "oAnimationEnd",
  40. "msAnimationEnd",
  41. "animationend"
  42. ],
  43. function(){
  44. this.parentNode.removeChild(this);
  45. });
  46. if (cover){
  47. cover.classList.add("coverFadeout");
  48. }
  49. }
  50. initialize(document);