Crie um blog

[img]https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy9OqLSdHruEQ73Dfghmtac2Z20NAGwmcdBdey1szjPOxqMxzxbAdKij1acGTWXjpfALkofImW3SC-Us0ESJEEtDMrbl3TK-u4cFTEdmLNRkDoc3mF3w5Ay6IXvy6uQ4TD_x8dCklY25w/s1600/c.png[img]https://www.google.com/accounts/NewAccount?service=blogger&continue=https%3A%2F%2Fwww.blogger.com%2Floginz%3Fd%3D%252Fcreate-blog.g%26a%3DADD_SERVICE_FLAG&hl=pt_BR&sendvemail=true&followup=https%3A%2F%2Fwww.blogger.com%2Floginz%3Fd%3D%252Fhome%26a%3DSERVICE_ONLY&naui=8[/url]

sexta-feira, 5 de novembro de 2010

Model7 3D rmvx

Screenshots
 
dowload
DOWLOAD
a casso não consiga baixar o script
#==============================================================================#
# ■ Mode 7 Script 1.5 for RMVX #
# |-> Author: Dusk Noun (24/1/09) #
# '-> Based on the original Script: 2chan (http://www.2ch.net/) #
#==============================================================================#
# ■ Chronology #
# |-> Analyzed the original script by 2chan #
# |-> Edit useful methods and created the needed windows #
# |-> BETA release -> Made the mode 7 independent with 2 bugs #
# '-> 1.5 -> Made the mode 7, you can evade bugs with work #
#==============================================================================#
# ■ Emproved from BETA #
# |-> Possibility to switch on/off the mode 7 #
# |-> Possibility to switch on/off the fader (evaded bug) #
# '-> Corrected mapping guide #
#==============================================================================#
# ■ Developing ideas #
# |-> Parallax on looped maps #
# |-> Angle settable #
# |-> Fix side-scrolling bitmap bug #
# '-> Add depth to characters #
#==============================================================================#
# ■ Notes of the author #
# - To avoid missunderstandings: I didn't create this script. I looked on the #
# script of the 2chan page (designed only for airships) and i made another #
# script based on it. So, I OWN this if they're credit as base script. I #
# haven't stolen anyone's idea. #
# - This is a BETA version. It's still developing so it shall have bugs #
#==============================================================================#
# ■ Instructions #
# - Place it above main #
# - $game_map.mode3D controls the on/off Mode 7 #
# - Call draw_fader (n) to put as fader n graphic (in pictures folder), put #
# nil to dispose the fader -> draw_fader(nil) #
#==============================================================================#
# ■ Compatibility #
# - This script changes the spriteset_map class and makes other 2 classes. No #
# compatibility errors detected but they could be #
#==============================================================================#

#==============================================================================#
# MODE 7 MAPPING GUIDE #
#==============================================================================#
=begin

One of the problems of this script is, the rules you need to respect to make a
map in perspective.

The 1st thing you need to know is, this script ONLY affects the map vision. The
players & events layer aren't touched, maybe in the 1st FINISHED release...

So you must repect the rules.

1. The fader
The fader is an image put over the events layer to simulate an horizont. It can
resemble useless but if we don't have it, the scrolling events will crash the
3-D enviroment. It's hard to explain, i'll try it:
Normally, the floor covers all the screen and the events scroll from up to
down always in the floor. But with Mode 7, the floor doesn't cover all the
screen, it leaves 3 rows (in this angle) without covering, and the scrolling
isn't touched so when the events are in those 3 rows, they're in the air. The
effect is that you'll see the events falling from the sky. The fader covers
those 3 lines so the events are shown only when they're in the floor. That way
you don't solve the problem but you neither see it.

To display a fader, call method draw_fader(i). If i's nil, fader will dispose..
Any other way, the variable must have the name of a graphic in pictures folder.
Note that that graphic must only cover the upper size. You can use the deafult
one for not making a new one.

NOTE: the draw_fader doesn't update never, if you start with a map with fader.
Call it in an autorun event. It's recommended to call it before transfering
the player to a new room, such as $game_map.mode3D to avoid the 1st frame of
the new room without the settings (if you call them on an autorun event, 1st
frame won't be affected by the event).

2. Vertical loop
If you have the vertical loop on or a map with a larger height than the screen
you must put a fader to avoid the events falling from sky when they appear at
the top of the screen.

If you don't have a vertical loop, you have the risk to end walking on the air.
To avoid that, i've calculated: the floor ends in the 3rd row from up to down.
So if you put a wall of non-sprite but solid and with the same priority as
characters events (to block the pass) in the 3rd row, you won't pass from the
floors limit.


3. Horizontal loop
If you put horizontal loop, you'll have no problem, just a view bug that will
dissappear once you've walked a bit.

If you don't put it, you'll have the problem as with non-vertical loop, you can
end walking in the air. And with the vertical, it was a line to block the pass,
but here there's no precision. If you don't block the pass, you end in tha air
and if you block it, there'sa piece of floor you can't pass. The best way is:
Put an empty event on the 2nd extremes tiles of the 4th row:
-------------
| || | | || | (4th row)
-------------
And put an empty event in the extremes of the 5th and 6th rows (you can get
inspired in the 3rd map of the demo if you have doubts.)

NOTE: all the tiles where to put empty events are thought for an angle of 60, if
you change the angle, everything changes.

NOTE: When you put a long height and none horizontal looped map... just as the
other non-looped maps, horizontally there's no problem untill the end of
the map.

DO NOT DO THIS
In mode 7, the map tileset is the floor and events are the rest. Don't make
buildings with map tiles or combine events with tiles. To draw buildings use
events with tiles sprite. Get inspired with the 1st map of the demo.


NOTE: $game_map.mode3D variable updates every frame so declare it true or false
before switching to a map.

=end

$m7_default = true # Default on/off mode 7 (just at the begining of the game)

module Game
DISPLAY_WIDTH = 544
DISPLAY_HEIGHT = 416

DISPLAY_CHIP_WIDTH = DISPLAY_WIDTH / 32
DISPLAY_CHIP_HEIGHT = DISPLAY_HEIGHT / 32

DISPLAY_REAL_WIDTH = DISPLAY_CHIP_WIDTH * 256
DISPLAY_REAL_HEIGHT = DISPLAY_CHIP_HEIGHT * 256

end


class Rect
def set_pos(x, y)
self.x = x
self.y = y
end

def set_size(w, h)
self.width = w
self.height = h
end
end


class TileBitmap < Bitmap
def initialize(width, height, tilemap)
super(width, height)
@tilemap = tilemap
@map_width = width / 32
@map_height = height / 32
@buffer = Bitmap.new(width, height)
@map_x = 999
@map_y = 999
@anime_face = 0
@anime_face_x = 0
@anime_speed = 30
@anime_count = @anime_speed
@main_autotile = MainAutotile.new(self, @tilemap.bitmaps)
@temprect = Rect.new(0,0,32,32)
@range = -1..1
end

def dispose
@buffer.dispose
@main_autotile.dispose
super
end

def set_tile(id, dx, dy)
case id
when 2048...2816
set_auto_tile1(id - 2048, dx, dy)
when 2816...4352
chipid, atid = (id -2816).divmod(48)
@main_autotile.draw(1,
atid, (chipid & 7) << 6 , (chipid >> 3) * 96, dx, dy, chipid)
when 4352...5888
set_auto_tile2(@tilemap.bitmaps[2], id - 4352, dx, dy)
when 5888...8000
set_auto_tile2(@tilemap.bitmaps[3], id - 5888, dx, dy)
when 1536...2048
set_normal_tile(@tilemap.bitmaps[4], id - 1536, dx, dy)
when 1...256
#0は書き込まない
set_normal_tile(@tilemap.bitmaps[5], id, dx, dy)
when 256...512
set_normal_tile(@tilemap.bitmaps[6], id - 256, dx, dy)
when 512...768
set_normal_tile(@tilemap.bitmaps[7], id - 512, dx, dy)
when 768...1536
set_normal_tile(@tilemap.bitmaps[8], id - 768, dx, dy)
end
end

def set_normal_tile(bitmap, id, dx, dy)
if(id < 128)
@temprect.set((id & 7) << 5, id >> 3 << 5, 32, 32)
else
id = id - 128
@temprect.set(((id & 7) + 8) << 5, id >> 3 << 5, 32, 32)
end
blt(dx, dy, bitmap, @temprect)
end

def set_auto_tile1(id, dx, dy)
chip_id, atid = id.divmod(48)

f = @anime_face
fx = @anime_face_x
case chip_id
when 0
@main_autotile.draw(0, atid, fx, 0, dx, dy, f)
when 1
@main_autotile.draw(0, atid, fx, 96, dx, dy, 8 + f)
when 2
@main_autotile.draw(0, atid, 192, 0, dx, dy, 3)
blt(dx, dy, @tilemap.bitmaps[0], Rect.new(192, 0, 32, 32))
when 3
blt(dx, dy, @tilemap.bitmaps[0], Rect.new(192, 96, 32, 32))
when 4
@main_autotile.draw(0, atid, 256 + fx, 0, dx, dy, f + 4)
when 6
@main_autotile.draw(0, atid, 256 + fx, 96, dx, dy, f + 12)
when 8
@main_autotile.draw(0, atid, fx, 192, dx, dy, f + 16)
when 10
@main_autotile.draw(0, atid, fx, 288, dx, dy, f + 20)
when 12
@main_autotile.draw(0, atid, 256 + fx, 192, dx, dy, f + 24)
when 14
@main_autotile.draw(0, atid, 256 + fx, 288, dx, dy, f + 28)
end

end

def anime_tile? (tile_id)
return tile_id && tile_id.between?(2048, 2815)
end

def set_auto_tile2(bitmap, id, dx, dy)
autotile_id = id % 48

real = id / 48
@temprect.set((real & 7) << 5, real >> 3 << 5, 32, 32)
blt(dx, dy, bitmap, @temprect)
end

def set_map(ox, oy)
return update_anime(ox, oy) if @map_x == ox && @map_y == oy

dir_x = ox - @map_x
dir_y = oy - @map_y
update_anime(ox - dir_x, oy - dir_y)
if @range === dir_x && @range === dir_y
case
when dir_x.zero? && dir_y == -1
copy_from_buffer(Rect.new(0, 0, width, height - 32), 0, 32)
draw_map(0, 0, ox, oy,
ox + @map_width, oy + 1)
when dir_x.zero? && dir_y == 1
copy_from_buffer(Rect.new(0, 32, width, height - 32), 0, 0)
draw_map(0, height - 32, ox, oy + @map_height - 1,
ox + @map_width, oy + @map_height)
when dir_y.zero? && dir_x == -1
copy_from_buffer(Rect.new(0, 0, width - 32, height), 32, 0)
draw_map(0, 0, ox, oy,
ox + 1, oy + @map_height)
when dir_y.zero? && dir_x == 1
copy_from_buffer(Rect.new(32, 0, width - 32, height), 0, 0)
draw_map(width - 32, 0, ox + @map_width - 1, oy,
ox + @map_width, oy + @map_height)

end

else
clear
draw_map(0, 0, ox, oy, ox + @map_width, oy + @map_height)
end
@map_x = ox
@map_y = oy
return true
end

def next_anime_face
@anime_face = (@anime_face + 1) % 3
@anime_face_x = @anime_face << 6
end

def update_anime(ox, oy)
if @anime_count.zero?
next_anime_face

x = y = dx = dy = 0
data = $game_map.data
map_each(ox+3, oy, ox + @map_width-3, oy + @map_height) do |x, y, dx, dy|
if anime_tile?(data[x, y, 0])
for z in 0..2
tile_id = data[x, y, z]
set_tile(tile_id, 96 + dx, dy) if tile_id
end
end
end

@anime_count = @anime_speed
return true
else
@anime_count -= 1
return false
end
end

def copy_from_buffer(r, bx, by)
@buffer.clear
@buffer.blt(0, 0, self, self.rect)

clear
blt(bx, by, @buffer, r)
end

def draw_map(tox, toy, ox, oy, xmax, ymax)
data = $game_map.data
x = y = dx = dy = 0
map_each(ox, oy, xmax, ymax) do |x, y, dx, dy|
for z in 0..2
tile_id = data[x, y, z]
set_tile(tile_id, tox + dx, toy + dy) if tile_id
end
end
end

def map_each(sx, sy, ex, ey)
mapw = $game_map.width
maph = $game_map.height
isv = $game_map.loop_vertical?
ish = $game_map.loop_horizontal?
draw_y = 0
for y in sy...ey
y = get_looped_point(y, maph) if isv
draw_x = 0
for x in sx...ex
x = get_looped_point(x, mapw) if ish
yield(x, y, draw_x, draw_y)
draw_x += 32
end
draw_y += 32
end
end

def get_looped_point(val, size)
return case
when size <= val then val -= size
when val < 0 then val += size
else val
end
end
end

class TileSprite < Sprite
def initialize(width, height, tilemap, viewport)
super(viewport)
self.bitmap = Bitmap.new(Game::DISPLAY_WIDTH, Game::DISPLAY_HEIGHT)
self.x = 0
self.y = 0
self.ox = 0
self.oy = 0
self.z = 0
@backbuffer = TileBitmap.new(width, height, tilemap)
@bg = Sprite.new(viewport)
@bg.z = 1
@bg.blend_type = 1
@bg.bitmap = Cache.picture('m7')

@mapx = -999
@mapy = -999

@x_plus = (width - Game::DISPLAY_WIDTH) / 2
@y_plus = 128

@draw_count = false

@x_table = Table.new(416)
@y_table = Table.new(416)
set_render_table(45)
end

def dispose
@bg.dispose if @bg
@backbuffer.dispose if @backbuffer
self.bitmap.dispose if self.bitmap
super
end

def hide
self.visible = false
@bg.visible = false
end

def show
self.visible = true
@bg.visible = true
end


def set_render_table(angle)
return false if angle == @angle
@angle = angle
d = 400.0
rad = angle * Math::PI / 180
sina = Math.sin(rad)
cosa = Math.cos(rad)

x_zoom = 272 * 1.5
for i in 0...416

sy = 208 - i

unless angle == 90
aaa = sy == 0 ? 0: (90 - angle) / 208.0 * sy
aaa = sy < 0 ? 90 + aaa : 90 - aaa
rad = aaa * Math::PI / 180
sy = (sy / Math.sin(rad)) * (d + (sy * Math.cos(rad))) / d
end


to_y = sina.zero? ? -256: ((sy / sina) * (d + (sy * cosa)) / d).round
@y_table[i] = 208 - to_y

to_x = (-x_zoom * (d + (sy * -cosa)) / d) + x_zoom
@x_table[i] = - (272 * to_x / (272 - to_x )).round
end

case @angle
when 45
@bg.zoom_y = 1.0
when 90
@bg.zoom_y = 0.0
else
@bg.zoom_y = (1.0 / 45) * (90 - @angle)
end
@bg.opacity = 255 * @bg.zoom_y
return true
end



def update_map(ox, oy)
return unless self.visible

aox = ($game_map.display_x >> 3 & 31) + @x_plus
aoy = ($game_map.display_y >> 3 & 31) + @y_plus

ud = set_render_table($game_map.get_angle)
sd = @backbuffer.set_map(ox, oy)
return if !sd && !ud && aox == @mapx && aoy == @mapy
update_bitmap(aox, aoy)
end

def update_bitmap(aox, aoy)
@mapx = aox
@mapy = aoy

unless aox == @x_plus && aoy == @y_plus
@draw_count = !@draw_count
return if @draw_count
end

bmp = self.bitmap
bmp.clear

bmph = bmp.height
bmpw = bmp.width

yt = @y_table
xt = @x_table
bb = @backbuffer
from_r = Rect.new(0, 0, 1 , 1)
to_r = Rect.new(0, 0, bmpw, 1)
i = 0
while i < bmph
to_y = yt[i]
if to_y < -@y_plus
i += 1
next
end

to_x = xt[i]
to_r.y = i

ww = 0
while i < bmph
ww += 1
i += 1
break unless to_x == xt[i] && to_y + ww == yt[i]
end


to_r.height = ww
from_r.set(to_x + aox, to_y + aoy, bmpw - to_x - to_x, ww)
bmp.stretch_blt(to_r, bb, from_r)
end
end


end

class Game_Map
attr_accessor :mode3D
attr_accessor :map_id

alias a9_003_initialize initialize
def initialize
a9_003_initialize
@mode3D = $m7_default
@angle3D = 60
end

def set_angle(v)
@angle3D = v
end

def get_angle
@angle3D
end

end

class Spriteset_Map
alias a9_003_create_viewports create_viewports
def create_viewports
a9_003_create_viewports
@viewport_invisible = Viewport.new(0, 0, 1, 1)
@viewport_invisible.visible = false
end

alias a9_003_dispose_viewports dispose_viewports
def dispose_viewports
a9_003_dispose_viewports

@viewport_invisible.dispose
end
alias a9_003_create_tilemap create_tilemap
def create_tilemap
a9_003_create_tilemap
@tilemap.visible = false
@tile_sprite = TileSprite.new(544+448, 416+128, @tilemap, @viewport1)
end

def begin_3d
@tilemap.viewport = @viewport_invisible
@mode3d = true
@tile_sprite.show
end

def end_3d
@tilemap.viewport = @viewport1
@mode3d = false
@tile_sprite.hide
end

alias a9_003_dispose_tilemap dispose_tilemap
def dispose_tilemap
a9_003_dispose_tilemap
@tile_sprite.dispose
end



alias a9_003update_tilemap update_tilemap
def update_tilemap
g = $game_map
unless g.mode3D == @mode3d
@mode3d ? end_3d: begin_3d
end
unless @mode3d
a9_003update_tilemap
else
@tile_sprite.update_map((g.display_x >> 8) - 7, (g.display_y >> 8) - 4)
end
end
end

class Game_Vehicle < Game_Character

#--------------------------------------------------------------------------
# ● Not sure if it's removable
#--------------------------------------------------------------------------
alias a9_003_update update
def update
a = @altitude
a9_003_update
update_angle(a)
end

def update_angle(alti)
def set_angle
$game_map.set_angle(90 - (45 / 8 * (@altitude / 4 + 1)))
end
end
end
#-------------------------------------------------------------------------

class MainAutotile
def initialize(parent, tilebitmaps)
super()
@parent = parent
@bitmaps = tilebitmaps

@rect = Rect.new(0, 0, 16, 16)
@lt_buffer = {0=>1, 4=>1, 6=>1, 8=>1, 12=>1, 19=>1, 23=>1, 32=>1, 33=>1}
@lt_buf_0 = {0=>1, 4=>1, 6=>1, 8=>1, 12=>1}
@lt_buf_1 = {19=>1, 32=>1}
@lt_buf_2 = {23=>1,33=>1}
@lt_1 = {1=>1, 3=>1, 5=>1, 7=>1, 9=>1, 11=>1, 13=>1,
15=>1, 26=>1, 27=>1, 29=>1, 31=>1, 39=>1}
@lt_2 = {34=>1, 35=>1, 42=>1, 43=>1, 46=>1 }
@lt_3 = {20=>1, 21=>1, 22=>1, 36=>1, 37=>1, 45=>1}#23, 33
@lt_4 = {16=>1, 17=>1, 18=>1, 40=>1, 41=>1, 44=>1}#17..19, 32
@lt_5 = {2=>1, 4=>1, 8=>1, 10=>1, 14=>1, 24=>1,
25=>1, 28=>1, 30=>1, 38=>1}#0, 6, 12

@rt_buffer = {27=>1}
@rt_height = {6=>1, 14=>1, 20=>1, 22=>1, 27=>1, 28=>1, 29=>1}#7

@lb_buffer = {1=>1, 2=>1, 3=>1, 31=>1}
@lb_width = {1=>1, 2=>1, 3=>1, 12=>1, 14=>1, 16=>1, 17=>1, 26=>1, 31=>1}

make_buffer
end

def draw(bmpNo, atid, ox, oy, dx, dy, bufid)
r = @rect
r.set_size(16, 16)
b = @parent
bw = bufid << 5
bmps = rect = nil
return if draw_lt(r, atid, ox, oy, bw) do |bmps, rect|
b.blt(dx, dy, bmps[bmpNo], rect)
end

draw_rt(r, atid, ox, oy, bw) do |bmps, rect|
b.blt(dx + 16, dy, bmps[bmpNo], rect)
end

return if draw_lb(r, atid, ox, oy, bw) do |bmps, rect|
b.blt(dx, dy + 16, bmps[bmpNo], rect)
end

draw_rb(r, atid, ox, oy) do |bmps, rect|
b.blt(dx + 16, dy + 16, bmps[bmpNo], rect)
end
end

def dispose
@buffers.each do |v|
v.dispose
end
end

private

def make_buffer
@buffers = []

bmp1 = Bitmap.new(1024, 96)
@buffers[0] = bmp1
tobmp = @bitmaps[0]
for i in 0..6
draw_buffer(tobmp, i * 64, 0, bmp1, i * 32, 0)
end
for i in 0..6
draw_buffer(tobmp, i * 64, 96, bmp1, 256 + (i * 32), 0)
end
for i in [0, 1, 2, 4, 5, 6]
draw_buffer(tobmp, i * 64, 192, bmp1, 512 + (i * 32), 0)
end
for i in [0, 1, 2, 4, 5, 6]
draw_buffer(tobmp, i * 64, 288, bmp1, 768 + (i * 32), 0)
end

bmp2 = Bitmap.new(1024, 96)
@buffers[1] = bmp2
tobmp = @bitmaps[1]
for i in 0..7
draw_buffer(tobmp, i * 64, 0, bmp2, i * 32, 0)
end
for i in 0..7
draw_buffer(tobmp, i * 64, 96, bmp2, 256 + (i * 32), 0)
end
for i in 0..7
draw_buffer(tobmp, i * 64, 192, bmp2, 512 + (i * 32), 0)
end
for i in 0..7
draw_buffer(tobmp, i * 64, 288, bmp2, 768 + (i * 32), 0)
end
end

def draw_buffer(bmp, ox, oy, tobmp, tox, toy)
r = Rect.new(0, 0, 16, 16)
r.set_pos(ox + 32, oy + 64)
tobmp.blt(tox, toy, bmp, r)
r.set_pos(ox + 16, oy + 64)
tobmp.blt(tox + 16, toy, bmp, r)
r.set_pos(ox + 32, oy + 48)
tobmp.blt(tox, toy + 16, bmp, r)
r.set_pos(ox + 16, oy + 48)
tobmp.blt(tox + 16, toy + 16, bmp, r)

r.set_pos(ox, oy + 64)
tobmp.blt(tox, toy + 32, bmp, r)
r.set_pos(ox + 48, oy + 64)
tobmp.blt(tox + 16, toy + 32, bmp, r)
r.set_pos(ox, oy + 48)
tobmp.blt(tox, toy + 48, bmp, r)
r.set_pos(ox + 48, oy + 48)
tobmp.blt(tox + 16, toy + 48, bmp, r)

r.set_pos(ox + 32, oy + 32)
tobmp.blt(tox, toy + 64, bmp, r)
r.set_pos(ox + 16, oy + 32)
tobmp.blt(tox + 16, toy + 64, bmp, r)
r.set_pos(ox + 32, oy + 80)
tobmp.blt(tox, toy + 80, bmp, r)
r.set_pos(ox + 16, oy + 80)
tobmp.blt(tox + 16, toy + 80, bmp, r)
end

def draw_lt(r, atid, ox, oy, bx)
case
when @lt_buf_0.key?(atid)
r.x = bx
r.y = 0
when @lt_buf_1.key?(atid)
r.x = bx
r.y = 32
when @lt_buf_2.key?(atid)
r.x = bx
r.y = 64
when @lt_1.key?(atid)
r.x = ox + 32
r.y = oy
when @lt_2.key?(atid)
r.x = ox
r.y = oy + 32
when @lt_3.key?(atid)
r.x = ox + 32
r.y = oy + 32
when @lt_4.key?(atid)
r.x = ox
r.y = oy + 64
when @lt_5.key?(atid)
r.x = ox + 32
r.y = oy + 64
end
bool = false
case atid
when 0, 15, 32..34, 36, 38, 40
r.set(r.x, r.y, 32, 32)
bool = true
when 3, 4, 7, 8, 11, 12, 16, 18, 23, 25, 35, 37
r.width = 32
when 6, 9, 13, 19, 20, 28, 41
r.height = 32
end
yield(@lt_buffer.key?(atid) ? @buffers : @bitmaps , r)
return bool
end

def draw_rt(r, atid, ox, oy, bx)
if case atid
when 27
r.set_pos(bx + 16, 32)
when 2, 6, 10, 14, 15, 17, 19, 30, 31, 41 #2, 3, 7, 11
r.set_pos(ox + 48, oy)
when 1, 5, 9, 13, 28, 29, 40 #0, 1, 4, 8, 12, 16, 18
r.set_pos(ox + 16, oy + 64)
when 20..22, 34, 43 #35, 33, 23
r.set_pos(ox + 16, oy + 32)
when 24, 26, 38, 39, 44 #25, 27, 32
r.set_pos(ox + 48, oy + 64)
when 36, 42, 45, 46 #37
r.set_pos(ox + 48, oy + 32)
end then
r.set(r.x, r.y, 16, @rt_height.key?(atid) ? 32: 16)
yield(@rt_buffer.key?(atid) ? @buffers : @bitmaps, r)
end
return false
end

def draw_lb(r, atid, ox, oy, bx)
if case atid
when 1, 2, 3
r.set_pos(bx, 16)
when 31
r.set_pos(bx, 80)
when 8, 10, 11, 12, 14, 15, 22, 23, 25, 27, 37 #9, 13
r.set_pos(ox + 32, oy + 16)
when 4, 5, 7, 21, 24, 26, 36 #0, 1,2,3, 6, 20
r.set_pos(ox + 32, oy + 48)
when 16, 17, 18, 32, 34, 35, 42 #19
r.set_pos(ox, oy + 48)
when 29, 30, 38, 39, 45 #28, 33, 31
r.set_pos(ox + 32, oy + 80)
when 40, 43, 44, 46 #41
r.set_pos(ox, oy + 80)
end then
is_buf = @lb_width.key?(atid)
r.set(r.x, r.y, is_buf ? 32: 16, 16)
yield(@lb_buffer.key?(atid) ? @buffers : @bitmaps, r)
return is_buf || @rt_height.key?(atid)
end
return false
end

def draw_rb(r, atid, ox, oy)
case atid
when 4, 5, 7, 13, 15, 18, 19, 21, 23, 35 #6, 12, 14
r.set_pos(ox + 48, oy + 16)
when 8..11, 16, 34 #0,1,2,3, 17, 20, 22
r.set_pos(ox + 16, oy + 48)
when 24, 25, 27, 32, 36, 37, 42 #26
r.set_pos(ox + 48, oy + 48)
when 30, 40, 41, 43 #28, 29, 31, 33
r.set_pos(ox + 16, oy + 80)
when 38, 39, 44..46
r.set_pos(ox + 48, oy + 80)
else return
end
yield (@bitmaps, r)
end
end

# Global method
def draw_fader(img)
if img != nil
$wall = Sprite.new
$wall.bitmap = Cache.picture(img)
$wall.x = 0
$wall.y = 0
$wall.z = 300
else
$wall.dispose
end
end

2 comentários:

  1. O isso funciona no rpg maker vx ace?

    ResponderExcluir
    Respostas
    1. não, mas pode achar um aki:
      http://www.mundorpgmaker.com.br/topic/89982-mode7-rmvx-ace-e-h-mode7-vx-ace/

      Excluir

coment ou mande uma mensagen pro topco