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.

45 líneas
924B

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