A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

48 líneas
981B

  1. import GlobalEvents from "/app/js/EventCaller.js";
  2. function handle_emitter(event){
  3. var el = event.target;
  4. if (el){
  5. if (el.hasAttribute("emit")){
  6. var args = [el.getAttribute("emit")];
  7. if (el.hasAttribute("emit-args")){
  8. try {
  9. var j = JSON.parse(el.getAttribute("emit-args"));
  10. if (j instanceof Array){
  11. args.concat(j);
  12. } else {
  13. args.push(j);
  14. }
  15. } catch (e) {
  16. console.log("Failed to emit '" + args[0] + "'. Attribute 'emit-args' contains malformed JSON.");
  17. }
  18. }
  19. GlobalEvents.emit.apply(GlobalEvents, args);
  20. }
  21. }
  22. }
  23. export default {
  24. initialize: function(){
  25. var elist = document.querySelectorAll("[emit]");
  26. elist.forEach(function(el){
  27. el.addEventListener("click", handle_emitter);
  28. });
  29. },
  30. initialize_element: function(el){
  31. if (el.hasAttribute("emit")){
  32. el.addEventListener("click", handle_emitter);
  33. }
  34. }
  35. }