Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
| # use comment tag to define event sizes | |
| # the sizes will be used as unit, one unit = 32 pixels | |
| # | |
| # comment tag: | |
| # | |
| # big event: X Y | |
| # with X is the width | |
| # with Y is the height | |
| # | |
| # Free for commercial usages. | |
| # Author: Dr.Yami | |
| class Game_Event < Game_Character | |
| def note | |
| begin | |
| data = [] | |
| @page.list.each do |item| | |
| next unless item && (item.code == 108 || item.code == 408) | |
| data.push(item.parameters[0]) | |
| end | |
| return data | |
| rescue | |
| return [] | |
| end | |
| end | |
| def event_height | |
| note.each do |line| | |
| if line =~ /big event:[ ]*(\d+)[ ]+(\d+)/i | |
| return $2.to_i - 1 | |
| end | |
| end | |
| return 0 | |
| end | |
| def event_width | |
| note.each do |line| | |
| if line =~ /big event:[ ]*(\d+)[ ]+(\d+)/i | |
| return $1.to_i - 1 | |
| end | |
| end | |
| return 0 | |
| end | |
| def pos?(x, y) | |
| if event_width % 2 == 0 | |
| in_x = (x <= @x + event_width / 2) && (x >= @x - event_width / 2) | |
| else | |
| in_x = (x <= @x + event_width / 2) && (x >= @x - event_width / 2 - 1) | |
| end | |
| in_y = (y >= @y - event_height) && (y <= @y) | |
| in_x && in_y | |
| end | |
| end |