• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Direction Boards

Direction Boards 2017-05-30

Pokémon Essentials Version
v16.2 ➖
A super tiny script for direction message-board pop-ups. The graphics are supposed to be changed (as they're quite bad), but here's what it could look like:
Sample.png

The graphics are 100% changeable and should be dynamic with any screen size.

Put the following sprites in the respective folders.

That's all. You can paste it in a new script section or anywhere else.
Code:
def pbDirBoard(text, dir = nil, speed = 16, windowskin = "directionBoard")
  vp = Viewport.new(0, 0, Graphics.width, Graphics.height)
  vp.z = 99999
  sp = {}
  sp[:box] = Sprite.new(vp)
  sp[:box].bitmap = Bitmap.new("Graphics/Windowskins/#{windowskin}")
  sp[:box].y = Graphics.height
  sp[:bmp] = Sprite.new(vp)
  sp[:bmp].bitmap = Bitmap.new(Graphics.width, Graphics.height)
  sp[:bmp].z = 1
  pbSetSystemFont(sp[:bmp].bitmap)
  drawTextEx(sp[:bmp].bitmap,32,Graphics.height - sp[:box].bitmap.height / 2 - 16,
                Graphics.width,2,text,Color.new(64,64,64),Color.new(172,172,172))
  sp[:bmp].y += sp[:box].bitmap.height
  sp[:dir] = Sprite.new(vp)
  begin
    sp[:dir].bitmap = Bitmap.new("Graphics/Pictures/board#{dir}")
    sp[:dir].ox = sp[:dir].bitmap.width
    sp[:dir].oy = sp[:dir].bitmap.height / 2
    sp[:dir].y = Graphics.height - sp[:box].bitmap.height / 2
    sp[:dir].x = Graphics.width - 48
  rescue; end
  sp[:dir].y += sp[:box].bitmap.height
  speed.times do # Intro animation
    Graphics.update
    $scene.updateSpritesets
    sp[:box].y -= sp[:box].bitmap.height / speed
    sp[:bmp].y -= sp[:box].bitmap.height / speed
    sp[:dir].y -= sp[:box].bitmap.height / speed
  end
  loop do # Update input
    Graphics.update
    Input.update
    $scene.updateSpritesets
    break if Input.trigger?(Input::B)    || Input.trigger?(Input::C) ||
             Input.trigger?(Input::UP)   || Input.trigger?(Input::DOWN) ||
             Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
  end
  speed.times do # Outro animation
    Graphics.update
    $scene.updateSpritesets
    sp[:box].y += sp[:box].bitmap.height / speed
    sp[:bmp].y += sp[:box].bitmap.height / speed
    sp[:dir].y += sp[:box].bitmap.height / speed
  end
  pbDisposeSpriteHash(sp)
  vp.dispose
  pbWait(1)
end

Here are a few examples:

Code:
pbDirBoard("Eterna Forest")
Code:
pbDirBoard("Rusty Windmill", "Up", 8)
Code:
pbDirBoard("Rustboro City", "Left")
Code:
pbDirBoard("New Mauville", nil, 16, "directionBoard_2")



The directional arrows are supposed to be in Graphics/Pictures and they should start with "board". This will be a whole new direction - it's not bound to just "Left", "Right", "Up" or "Down". If you make a new graphic for "UpLeft", for instance, and call it "boardUpLeft" in your graphics folder, that'd be totally valid.

If you don't want to display an arrow, you can leave the second argument, "dir", empty. Look at Example 1 to see. You can also set the argument to "nil". Look at Example 4 to see.

The speed argument is for how fast the message box should slide into screen (along with the arrow and the message). This speed is also used for closing. (If you go too high, it may not slide all the way to the correct position.)

The windowskin used for the message box should be in Graphics/Windowskins.
Resource suggested by AceTrainerGresh.
Credits
  • Marin
Author
Marin
Views
1,092
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Marin

Back
Top