A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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