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个字符

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import EventWindow from "/app/js/ui/EventWindow.js";
  2. import Modal from "/app/js/ui/Modal.js";
  3. import {NESPainter} from "/app/js/NESPainter.js";
  4. import {NESPalette} from "/app/js/NESPalette.js";
  5. function on_palette_changed(e){
  6. if (e.type == "ALL"){
  7. console.log("ALL");
  8. } else if (e.type == "TILE"){
  9. console.log("TILE Palette:", e.pindex, " | Color:", e.cindex);
  10. } else if (e.type == "SPRITE"){
  11. console.log("SPRITE Palette:", e.pindex, " | Color:", e.cindex);
  12. }
  13. }
  14. function on_click(e){
  15. console.log(e.target);
  16. }
  17. function handle_emitted(){
  18. console.log("EMITTED EVENT!");
  19. }
  20. function initialize(DOC){
  21. EventWindow.listen("onclick", on_click);
  22. EventWindow.enable_emitter_attributes();
  23. EventWindow.listen("emitted-event", handle_emitted);
  24. var nespainter = new NESPainter(DOC.getElementById("painter"));
  25. console.log(nespainter.scale);
  26. nespainter.scale_up(5);
  27. console.log(nespainter.scale);
  28. var nespal = new NESPalette();
  29. nespal.listen("palettes_changed", on_palette_changed);
  30. nespal.set_palette([
  31. 44,
  32. 11,12,13,
  33. 54,23,43,
  34. 23,18,11,
  35. 4,8,60,
  36. 63,0,11,
  37. 0,15,14,
  38. 9,0,32,
  39. 5,10,20
  40. ]);
  41. console.log(nespal.to_asm());
  42. }
  43. //console.log(document.getElementByID("painter"));
  44. initialize(document);