class Game_Map
alias setup_special_events setup
def setup(map_id)
setup_special_events(map_id)
@map.events.each_value do |event|
# placeholder for code
end
end
end
if event.name.clone.gsub!(/\\[Ee]\[(\d+)\]/) {"#[$1]"}
# temporary variable for ID
id = $1.to_i
if event.name.match(/\\e\[(\d+)\]/i)
id = $1.to_i
event.pages[0].list.each do |command|
if command.code == 108 || command.code == 408
command.parameters.each do |comment|
if comment.match(/<e>/i)
print "I found an <e> tag!"
end
end
end
end
class Game_Map
alias setup_special_events setup
def setup(map_id)
setup_special_events(map_id)
@map.events.each_value do |event|
if event.name.match(/\\e\[(\d+)\]/i)
p "Event ID #{event.id} is an enemy of ID #{$1}"
end
event.pages[0].list.each do |command|
if command.code == 108 || command.code == 408
command.parameters.each do |comment|
if comment.match(/<e>/i)
p "Event ID #{event.id} has an <e> tag"
end
end
end
end
end
end
end
@map.events.each_value do |event|
check_for_enemy_in_name # def check_for_enemy_in_name
check_for_enemy_tag # def check_for_enemy_tag
end
class Myclass {
constructor(myCanvas){
this.canvas = myCanvas;
this.ctx = this.canvas.getContext('2d');
this.myImg = this.loadGraphic('images/myimg.png' this.setupBars);
}
loadGraphic(filename, callback){
let img = new Image();
img.src = filename;
img.onload = () => this.setupBars(); // callback arg ignored, This works but can not define the callback
//img.onload = () => { this.setupBars(); } // Works same as above, dont need {} characters
//img.onload = this.setupBars(); // callback arg ignored, Argument 1 could not be converted to any of Graphics
//img.onload = callback(); // callback = setupBars, setupBars is not defined
//img.onload = callback(); // callback = this.setupBars, this is undefined
//img.onload = this.callback(); // callback = setupBars, setupBars is undefined
//img.onload = this.callback(); // callback = this.setupBars, this.callback is not a function
//img.onload = () => callback(); // callback = this.setupBars, 'this' is undefined
//img.onload = () => callback(); // callback = setupBars, setupBars is not defined
//img.onload = () => this.callback(); // callback = setupBars, setupBars is not defined
//img.onload = (this) => callback(); // callback = this.setupBars, missing formal parameter
//img.onload = (this.callback) => callback(); // callback = this.setupBars, missing formal parameter
//img.onload = (callback) => this.callback(); // callback = this.setupBars, this.callback is not a function
//img.onload = (callback) => this.callback(); // callback = setupBars, setupBars is not defined
//img.onload = (this) => callback(); // callback = setupBars, missing formal parameter
//img.onload = (callback) => callback(); // callback = setupBars, callback is not a function
//img.onload = (callback) => callback(); // callback = this.setupBars, callback is not a function
//img.onload = function(){ this.setupBars() }; // callback arg ignored, 'this.setupBars' is not a function
//img.onload = function(this){ this.setupBars() }; // callback arg ignored, missing formal parameter
//img.onload = function(){ callback() }; // 'this' is undefined
//img.onload = function(callback){ callback() }; // callback = setupBars, setupBars is not defined
//img.onload = function(callback){ callback() }; // callback = this.setupBars, callback is not a function
//img.onload = function(this.callback){ callback() }; // callback = setupBars, Scrollbars is not defined
//img.onload = function(callback){ this.callback() }; // callback = setupBars, setupBars is not defined
//img.onload = function(callback){ callback() }; // callback = this.setupBars, callback is not a function
return img;
}
setupBars(){
// does drawing to canvas with loaded graphic
}