Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - newold

1
Doodad's Editor
Authors: Newold
Version: 1.0
Type: Custom Mapping System
Key Term: Game Utility



Introduction

With this tool you can enrich your maps with different images (even animated images). In game, you press F8 and the Doodads's Editor appear (only available in Debug Mode).


Features


  • Easy manager for your doodads with a beauty external editor

  • Auto installable

  • Compatible with RPG Maker XP, VX and VX ACE projects

  • Press F1 in the Doodad's Editor to display help

  • 2 DLL included: One with the embedded doodads editor and another lighter version without the editor (with light dll the doodads can not be edited)




Screenshots

Video available Here => https://www.youtube.com/watch?v=pJU2QAhAI84




Demo

Download Here (installer program): http://www.mediafire.com/file/aze4r7pgv6t5tg6/Doodads_Editor.rar/file


Script




Instructions

Installation is very simple. Just download the installer program. Unzip to the folder of your choice (rar file) and run executable Doodads Editor Installer.exe




Compatibility

This program required .NET Frameworks 2.0 (for the light dll) or  .NET Frameworks 4.0 (for the full dll)


Credits and Thanks


  • Me for sure ;)

  • and ForeverZer0 for Rpg.NET Export




Author's Notes

Enjoy
2
Sea of Code / Help with dll to use with RPG Maker
September 04, 2018, 05:56:16 pm
Hi all. I have the following problem:

In RPG Maker i have an array with this struct: [long, long, string]. Then, using Ruby function pack, i create this string:  [long, long, string].pack("lla*") and then i pass this string to my dll and i try change values with my function in dll. I can change value 0 and value 1, but not my string (value 2)

c++ DLL:

#include "stdafx.h"
#include <iostream>
#include <windows.h>

#define RGSSApi extern "C" __declspec(dllexport)

// I pass this struct from RPG Maker
struct ALGO
{
long value1;
long value2;
char * value3;
};


// This function is called by rpg maker and modify values.
RGSSApi void prueba(ALGO * object)
{
object->value1 = 100;
object->value2 += 200;
object->value3 = (char *)"other text";

}


RGSS script:

# My DLL
f = Win32API.new("f/MyDll.dll", "prueba", "P", "")

a = [1, 10, "Initial Text"] # My array

t = a.pack("lla*") # Pack array to string

# Show array 'a' contents, current 't' and 't' unpack
# a[0] = 1,  a[1] = 10,  a[2] = "Initial Text"
p a, t, t.unpack("lla*")

f.call(t) # Call function in c++ passing the value 't'

# Show array 'a' contents, current 't' and 't' unpack
# a[0] = 100,  a[1] = 210,  a[2] = value is wrong (it is different to "initial Text" (defined in rgss) and different to "other text" (defined in dll))
p a, t, t.unpack("lla*")

exit




any help here? im stuck :(
3
RMXP Script Database / Tetra Master [XP][VX][VXA]
March 18, 2017, 04:22:27 pm
TETRA MASTER
Authors: NEWOLD
Version: 0.1 - alpha
Type: CARDS MINI GAME (TETRA MASTER - FF IX)
Key Term: Minigame



Introduction

TETRAMASTER  is the game of cards of Final Fantasy 9. You can add it to RPG Maker XP, VX or ACE and works as minigame for your games.


Features


  • RPG MAKER XP, VX and ACE compatible

  • Easy config tool to config scripts

  • Scripts auto-installables

  • You can create custom messages for each enemies, for each turns, when win game, when lose game and when draw games

  • Support animate cards image

  • Include differents rules and pay methods when finish a battle

  • Script can activate/deactivate local switches and switches or change variable values when you lose or win a battle of cards

  • You can create uniq cards (Uniq cards there is only one. If you lose a uniq card, you can play with enemy that stole it to try recover the card if he play it)

  • If you lose a normal card, it is lose forever

  • You can create blocks that when it get destroyed, can give a buf/debuf at your cards or enemy cards

  • During the fighting, cards can show animations (animations from your game database)

  • Custom windows

  • Shop to sell/buy cards

  • Cards Album




Screenshots
Current Version Preview (no available for download yet)


Editor preview



Demo

Version alpha 0.1 (i upload current version in a few days)
Editor: Edtor Tetra Master
Demo: DEMO RPG MAKER XP (You can play the mini game "TetraMaster" talking to NPCs with the "D" key on your keyboards)


Script

see demo


Instructions

see editor


Compatibility




Credits and Thanks


  • Script Circular Gauges by efeberk

  • Galenmereth / Tor Damian Design (Formulas used in script 05 - Alter Motion)




Author's Notes

Scripts are in development phase. Stay tuned for updates
4
Scene Flying Letters
Authors: Newold
Version: 1.0
Type: Scene Flying letters
Key Term: Misc Add-on



Introduction

Create a scene how Star Wars intro


Features


  • Plug & Play

  • RPG Maker XP compatible

  • RPG Maker VX compatible

  • RPG Maker VX ACE compatible




Screenshots


Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide



Demo

no available.


Script

Spoiler: ShowHide
=begin
==============================================================================

SCRIPT CREADO POR NEWOLD
DE USO LIBRE PARA JUEGOS NO COMERCIALES

Título: Star Wars Letters
Para qué Sirve: Simula el efecto de letras volando por el espacio de star wars.
Fecha de Creación: 12-09-2014
Versión: 1.0

SI QUIERES USARLO EN UN PROYECTO COMERCIAL PONTE EN CONTACTO CONMIGO
todobasura31@hotmail.es

Instalación: Colocarlo encima del main (Compatible con RPG Maker XP, VX y ACE)

Para inicializar el script poner esto:

 scene = StarWarsLetters.new
 
Para configurar los diferentes apartados del script usad estos comandos:
-----------------------------------------------------------------------------
* Tipografía del texto:

scene.fontName = 'Nombre de la fuente'

* Color del texto:

scene.fontColor= color # color = Color.new(r,g,b,a)
                       # r,g,b,a = número entre 0-255

* Tamaño del texto:

scene.fontSize = número

* Altura máxima que alcanza el texto:

scene.top = número

* Tiempo en segundos en alcanzar el máximo alto:

scene.time = número

* Sesgado del texto

scene.angled = número

* Máximo zoom:

scene.maxZoom = número

* Espacio en píxels entre un texto y otro:

scene.margin = número

* Resolución del maker horizontal:

scene.w = número

* Resolución del maker vertical:

scene.h = número

* Añadir un fondo con o sin movimiento:

scene.set_background('Dirección imagen',velocidad X, Velocidad Y)

* Añadir música de fondo:

scene.set_music('Dirección música',volumen)

* Añadir el texto que vuela por la pantalla:

scene.data = ['Texto1', 'Texto2', '...', 'textoN']

* Añadir Título/s inical/es antes de que vuele el texto:

scene.set_title(title,fontName,fontSize,fontColor, align, zoom, time,timeout)

 title = ['Texto para ese título']  # ['line1','line2','...','lineN']
 fontName = 'Nombre de la tipografía'
 fontSize = número # Tamaño del texto
 fontColor = color
 # color = Color.new(r,g,b,a) || r,g,b,a = número entre 0-255
 align = número # Alineación del texto || 0 = Izquierda, 1 = Centro, 2 = Derecha
 zoom = número # Zoom para el texto.
               # Si pones un zoom diferente de 1 se producirá un efecto
               # de zoom-out. Si lo pones en 1 el efecto será opacity-out.
 time = número # Tiempo en segundos que tarda en aparecer el texto
 timeout = número # Tiempo en segundos que tarda en desaparecer el texto
 
-----------------------------------------------------------------------------

Una vez configurado el script usa el comando

scene.preload

para realizar una precarga de datos y usa el comando

scene.start para mostrar el resultado.

(Nota: El script termina cuando el texto volador se pierde en el horizonte
o cuando se pulsa B y ya no se está mostrando ningún título inicial.
Si se pulsa B mientras se muestra un título éste termina y se muestra el
siguiente si ubiera o se empieza a mostrar el texto volador)
 
==============================================================================
=end


# ==============================================================================
class Point # by Newold
 #--------------------------------------------------------------------------
 attr_accessor  :x
 attr_accessor  :y
 #--------------------------------------------------------------------------
 def initialize(x=0,y=0)
   @x = x; @y = y
 end
 #--------------------------------------------------------------------------
 def ==(point)
   return (self.x == point.x and self.y == point.y)
 end
 #--------------------------------------------------------------------------
 def ===(point)
   return (self.x.eql?(point.x) and self.y.eql?(point.y))
 end
 #--------------------------------------------------------------------------
 def to_a
   return [self.x.floor,self.y.floor]
 end
 #--------------------------------------------------------------------------
 def to_s
   return "[#{self.x.to_i}x, #{self.y.to_i}y]"
 end
 #--------------------------------------------------------------------------
 def dup
   return Point.new(@x,@y)
 end
 #--------------------------------------------------------------------------
 def _dump(d=0)
   s = [3].pack('L')
   s = [@x].pack("F")
   s << [@y].pack("F")
   s
 end
 #--------------------------------------------------------------------------
 def self._load(s)
   x = s[0,4].unpack("F")[0]
   y = s[4,4].unpack("F")[0]
   point = Point.new(x,y)
   return point
 end
end
# ==============================================================================

#===============================================================================
class Bitmap # << by NEWOLD
 #--------------------------------------------------------------------------
 #  transferPoint:
 
 #  Transfiere un punto de una imagen a otra deformada tomando en cuenta las
 #  4 esquinas de la imagen normal y las 4 esquinas de la imagen deformada

 #  Parámetetros:
 
 #  xI = Coordenada x en la imagen original
 #  yI = Coordenada y en la imagen original

 #  source = Array de esquinas de la imagen original
 #  (siguiendo el sentido de las agujas del reloj
 #  desde esquina superior izquierda a esquina inferior izquierda)
 #  Ejemplo:
 #  source = [];
 #  source[0] = Point.new(0, 0);
 #  source[2] = Point.new(200,100);

 #  destination = Array de esquinas de la imagen distorsionada (perspectiva)
 #  (siguiendo el sentido de las agujas del reloj
 #  desde esquina superior izquierda a esquina inferior izquierda)
 #  Ejemplo:
 #  destination = [];
 #  destination[n] = Point.new(0, 0); # n= 0...4
 
 #--------------------------------------------------------------------------
 def transferPoint (xI, yI, source, destination)
   adding = 0.001; # (para evitar dividir por 0)
 
   xA = source[0].x.to_f;
   yA = source[0].y.to_f;
 
   xC = source[2].x.to_f;
   yC = source[2].y.to_f;
     
   xAu = destination[0].x.to_f;
   yAu = destination[0].y.to_f;
 
   xBu = destination[1].x.to_f;
   yBu = destination[1].y.to_f;
 
   xCu = destination[2].x.to_f;
   yCu = destination[2].y.to_f;
 
   xDu = destination[3].x.to_f;
   yDu = destination[3].y.to_f;
 
   # Cálculos
   # (si los puntos son iguales hay que añadir 'adding' para evitar división 0)
   if (xBu==xCu); xCu+=adding; end;
   if (xAu==xDu); xDu+=adding; end;
   if (xAu==xBu); xBu+=adding; end;
   if (xDu==xCu); xCu+=adding; end;
   kBC = (yBu-yCu)/(xBu-xCu);
   kAD = (yAu-yDu)/(xAu-xDu);
   kAB = (yAu-yBu)/(xAu-xBu);
   kDC = (yDu-yCu)/(xDu-xCu);
 
   if (kBC==kAD); kAD+=adding; end;
   xE = (kBC*xBu - kAD*xAu + yAu - yBu) / (kBC-kAD);
   yE = kBC*(xE - xBu) + yBu;
 
   if (kAB==kDC); kDC+=adding; end;
   xF = (kAB*xBu - kDC*xCu + yCu - yBu) / (kAB-kDC);
   yF = kAB*(xF - xBu) + yBu;
 
   if (xE==xF); xF+=adding; end;
   kEF = (yE-yF) / (xE-xF);
 
   if (kEF==kAB); kAB+=adding; end;
   xG = (kEF*xDu - kAB*xAu + yAu - yDu) / (kEF-kAB);
   yG = kEF*(xG - xDu) + yDu;
 
   if (kEF==kBC); kBC+=adding; end;
   xH = (kEF*xDu - kBC*xBu + yBu - yDu) / (kEF-kBC);
   yH = kEF*(xH - xDu) + yDu;
 
   rG = (yC-yI)/(yC-yA);
   rH = (xI-xA)/(xC-xA);
 
   xJ = (xG-xDu)*rG + xDu;
   yJ = (yG-yDu)*rG + yDu;
 
   xK = (xH-xDu)*rH + xDu;
   yK = (yH-yDu)*rH + yDu;
 
   if (xF==xJ); xJ+=adding; end;
   if (xE==xK); xK+=adding; end;
   kJF = (yF-yJ) / (xF-xJ);
   kKE = (yE-yK) / (xE-xK);
 
   if (kJF==kKE); kKE+=adding; end;
   xIu = (kJF*xF - kKE*xE + yE - yF) / (kJF-kKE);
   yIu = kJF * (xIu - xJ) + yJ;
 
   b=Point.new(xIu.floor,yIu.floor);
   return b;
 end
 #--------------------------------------------------------------------------
end
#===============================================================================


# ==============================================================================
class StarWarsLetters
 #--------------------------------------------------------------------------
 attr_accessor :fontName, :fontSize, :fontColor, :data, :top, :time, :angled,
               :maxZoom, :margin, :w, :h
 #--------------------------------------------------------------------------
 def initialize(*args)
   @fontName = args[0].nil? ? ['Verdana','Times New Roman','Arial'] : args[0]
   @fontSize = args[1].nil? ? 46 : [args[1].to_i,6].max
   @fontColor = args[2].nil? ? Color.new(255,255,0) : args[2]
   @data = args[3].nil? ? [] : args[3]
   @top = args[4].nil? ? 270 : args[4].to_i
   @time = args[5].nil? ? 35 : [args[5].to_i,1].max
   @angled = args[6].nil? ? 85.0 : ([args[6].to_i,0].max).to_f
   @maxZoom = args[7].nil? ? 2.5 : ([args[7].to_i,0.1].max).to_f
   @margin = args[8].nil? ? -30 : args[8].to_i
   @background = nil
   @vx = 0
   @vy = 0
   @ox = @oy = 0
   @music = nil
   @maxVol = 100
   @vol = 0
   @sprites = []
   @points = {}
   @w = 640
   @h = 480
   @title = []
 end
 #--------------------------------------------------------------------------
 def set_title(title,fontName='Verdana',fontSize=36,
   fontColor=Color.new(0,0,160), align=0, zoom=1.0, time=3,timeout=4)
   timer = time * Graphics.frame_rate * 1.0
   timer2 = timeout * Graphics.frame_rate * 1.0
   b = Bitmap.new(1,1)
   b.font.name = fontName
   b.font.size = fontSize
   w = h = 1
   for i in 0...title.size
     size = b.text_size(title[i].to_s)
     w = size.width if w < size.width
     h = size.height if h < size.height
   end
   s = Sprite.new
   s.bitmap = Bitmap.new(w,h*(title.size > 0 ? title.size : 1))
   s.bitmap.font.name = fontName
   s.bitmap.font.size = fontSize
   s.bitmap.font.color = fontColor
   for i in 0...title.size
     s.bitmap.draw_text(0,h*i,w,h,title[i],align)
   end
   s.zoom_x = s.zoom_y = zoom
   s.opacity = 0
   s.x = (@w/2) - (s.bitmap.width * s.zoom_x / 2)
   s.y = (@h/2) - (s.bitmap.height * s.zoom_y / 2)
   @title << [s,timer,timer2,true,zoom,zoom/(timer+timer2)]
 end
 #--------------------------------------------------------------------------
 def set_background(dir,vx=0,vy=0)
   @background = Plane.new
   @background.bitmap = Bitmap.new(dir)
   @background.visible = false
   @vx = vx.to_f
   @vy = vy.to_f
 end
 #--------------------------------------------------------------------------
 def set_music(dir,vol=100)
   @music = dir
   @maxVol = vol
 end
 #--------------------------------------------------------------------------
 def find_zoom(text)
   b = Bitmap.new(1,1)
   b.font.name = @fontName
   b.font.size = @fontSize
   zoom = 1
   size = b.text_size(text)
   if size.width == 0 or size.height == 0
     p "Font <#{@fontName}> incompatible with this RPG MAKER"
     p "Using font... ['Verdana','Times New Roman','Arial']"
     @fontName = ['Verdana','Times New Roman','Arial']
     find_zoom(text)
     return
   end
   while size.height * zoom < 115
     zoom += 0.1
   end
   while size.width * zoom > @w + 384
     zoom -= 0.1
   end
   @maxZoom = zoom
 end
 #--------------------------------------------------------------------------
 def start
   
   b = Bitmap.new(1,1)
   b.font.name = @fontName
   b.font.size = @fontSize
   size = b.text_size(' ')
   if size.width == 0 or size.height == 0
     p "Font <#{@fontName}> incompatible with this RPG MAKER"
     p "Using font... ['Verdana','Times New Roman','Arial']"
     @fontName = ['Verdana','Times New Roman','Arial']
   end
   Graphics.freeze
   unless @background.nil?
     @background.visible = true
   end
   Graphics.transition(20)
   while @data.size > 0 or @sprites.size > 0
     Input.update
     update
     update_background
     update_music
     Graphics.update
     if Input.trigger?(Input::B)
       if @title.size > 0
         obj = @title.shift
         obj[0].dispose
       else
         break
       end
     end
   end
   Graphics.freeze
   dispose
   Graphics.transition(20)
 end
 #--------------------------------------------------------------------------
 def update
   if @title.size > 0
     obj = @title[0]
     if obj[3]
       obj[1] -= 1
       obj[3] = false if obj[1] <= 0
       obj[0].opacity += 1
     else
       obj[2] -= 1
       if obj[2] < 22
         obj[0].opacity -= 12
       end
       if obj[2] <= 0
         @title.delete(obj)
         return
       end
     end
     if obj[4] != 1.0
       obj[0].zoom_x -= obj[5]
       obj[0].zoom_y = obj[0].zoom_x
       obj[0].x = (@w/2) - (obj[0].bitmap.width * obj[0].zoom_x / 2)
       obj[0].y = (@h/2) - (obj[0].bitmap.height * obj[0].zoom_y / 2)
     end
     return
   end
   if (@sprites.size == 0) or
     (@sprites[-1][0].y + @margin +
     @sprites[-1][0].bitmap.height * @sprites[-1][0].zoom_y <= @h)
     draw
   end
   timer = @time * Graphics.frame_rate * 1.0
   ratioZoom = @maxZoom / timer
   @sprites.each {|obj|
     obj[2] = obj[2] + ((@top - obj[2]) / timer)
     obj[0].y = [obj[2],@top].max - (obj[0].bitmap.height * obj[0].zoom_y / 2)
     if obj[0].y <= @top or obj[0].zoom_x < 0.4
       obj[0].opacity -= 2
       if obj[0].opacity == 0
         @sprites.delete(obj)
       end
     else
       obj[0].opacity += 2
     end
     obj[0].x = @w/2 - (obj[0].bitmap.width * obj[0].zoom_x / 2)
     ratioZoom = obj[0].zoom_x / timer
     obj[0].zoom_x -= ratioZoom
     obj[0].zoom_y = obj[0].zoom_x
   }
 end
 #--------------------------------------------------------------------------
 def update_background
   return if @background.nil?
   @ox += @vx
   @oy += @vy
   @background.ox = @ox
   @background.oy = @oy
 end
 #--------------------------------------------------------------------------
 def update_music
   return if @music.nil?
   Audio.bgm_play(@music,@vol)
   @vol = [@vol+5,@maxVol].max
 end
 #--------------------------------------------------------------------------
 def preload
   data = @data.dup
   while @data.size > 0
     draw(true)
   end
   @data = data
 end
 #--------------------------------------------------------------------------
 def draw(pl = false)
   text = @data.shift
   return if text.nil?
   b = Bitmap.new(10,10)
   b.font.name = @fontName
   b.font.size = @fontSize
   size = b.text_size(' ')
   s = Sprite.new
   s.bitmap = Bitmap.new(@w,size.height)
   s.bitmap.font.name = @fontName
   s.bitmap.font.size = @fontSize
   s.bitmap.font.color = @fontColor
   while s.bitmap.text_size(text).width > @w
     s.bitmap.font.size -= 1
   end
   s.bitmap.draw_text(0,0,@w,size.height,text,1)
   
   if @points.size == 0
     sz = s.bitmap.text_size(' ')
     source = [Point.new(0.0,0.0),nil,
     Point.new(s.bitmap.width.to_f+sz.width,s.bitmap.height.to_f+sz.height),nil]
     
     point1 = Point.new(@angled,0.0)
     point2 = Point.new(s.bitmap.width-@angled,0.0)
     point3 = Point.new(s.bitmap.width.to_f,s.bitmap.height.to_f)
     point4 = Point.new(0.0,s.bitmap.height.to_f)
     
     destination = [point1,point2,point3,point4]
     
     for y in 0...s.bitmap.height
       for x in 0...s.bitmap.width
         point = b.transferPoint(x.to_f, y.to_f, source, destination)
         @points[[x,y]] = [point.x,point.y]
       end
     end
   end
   if pl
     s.dispose
     return
   end
   b = s.bitmap.dup
   s.bitmap.clear
   for y in 0...s.bitmap.height
     for x in 0...s.bitmap.width
       color = b.get_pixel(x,y)
       s.bitmap.set_pixel(@points[[x,y]][0],@points[[x,y]][1],color)
     end
   end
   
   s.zoom_x = s.zoom_y = @maxZoom
   s.x = @w/2 - (s.bitmap.width * s.zoom_x / 2)
   s.y = @h + (s.bitmap.height * s.zoom_x / 2)
   s.opacity = 0
   
   @sprites << [s,s.x,s.y]
 end
 #--------------------------------------------------------------------------
 def dispose
   @sprites.each {|obj| obj[0].dispose}
   @sprites = []
   @title.each {|obj| obj[0].dispose}
   @title = []
 end
 #--------------------------------------------------------------------------
end
# ==============================================================================



Instructions


  • Put Script over main in you proyect

  • SET A NEW SCENE:

  • Command Initialize Script: scene = StarWarsLetters.new

  • CONFIGURE SCRIPT:

  • Font Name: scene.fontName = 'Font Name'

  • Font Color: scene.fontColor = color # color = Color.new(r,g,b,a) || r,g,b,a = number between 0-255

  • Font Size: scene.fontSize = number

  • Horizon height: scene.top = number

  • Time to reach the horizon: scene.time = number

  • Perspective Text Size (see explanatory image): scene.angled = number
    ]

  • Max Zoom: scene.maxZoom = number

  • Space between lines in flying text: scene.margin = number

  • Horizontal Screen Size (Width): scene.w = number

  • Vertical Screen Size (Height): scene.h = number

  • Add Background with/out movement: scene.set_background('Image dir',velocity X, Velocity Y)

  • Add background Music: scene.set_music('Music dir',volume)

  • Add Flying Text over Screen: scene.data = ['Text1', 'Text2', '...', 'textN']

  • Add Initial titles (see it before flying text): scene.set_title(title,fontName,fontSize,fontColor, align, zoom, time,timeout)
    title = ['Text for this title'] # ['Line1','Line2','...','LineN']
    fontName = 'Font Name'
    fontSize = number# Text Size
    fontColor = color # color = Color.new(r,g,b,a) || r,g,b,a = number between 0-255
    align = number# Text Align || 0 = Left, 1 = Center, 2 = Right
    zoom = number# Text Zoom || <> 1 effect zoom-out. == 1 effect opacity-out.
    time = number # Initial time in seconds (appearing text)
    timeout = number# Final time in seconds (disappearing text)

  • END CCONFIGURATION:

  • SHOW RESULT

  • scene.preload
    scene.start




Compatibility



Credits and Thanks


  • me!




Author's Notes


  • Script finish when all text disappear in a horizont or player press B button.

  • You can define 1 o more titles

  • Instruction in script are in spanish

  • You can use this script for non comercial games only

5
I am trying do a textbox with win32API with this code in rpg maker

#___________________________________________________________________________
ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
@title = "\0" * 256
ini.call('Game', 'Title', '', @title, 256, '.\\Game.ini')
@title.delete!("\0")
# Getel hwnd from rgss player
@hwnd = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', @title)

@create_window = Win32API.new('user32','CreateWindowEx','lpplllllllll','l')
# Build textbox
#style = WS_CHILD|WS_CLIPCHILDREN|WS_VSCROLL|ES_MULTILINE
style = 0x40000000|0x02000000|0x00200000|0x0004
x, y, w, h = 100, 100, 160, 120
@script_window = @create_window.call(0, 'Edit', '', style, x, y, w,h, @hwnd, 0, 0, 0)
#___________________________________________________________________________

i want create the window edit as child of parent window (rgss player). With that code i get create de window as chlid but it appear behind of the parent window. If you put de mouse over edit window it blink, shown by an instant and sets again behind the parent window (the edit window work but it is behind the parent window).

How i get that my child window set over the parent window and dont blink or get behind again?
6
RMXP Script Database / [XP][VX][VXA] New Transition script
September 20, 2013, 03:45:14 pm
NEW TRANSITION FOR ALL RPG MAKERS
Authors: NEWOLD
Version: 1.0
Type: Displays a transition similar to Paper Mario game in Game Cube
(Great for use before changing scene!!!)

Key Term: Misc Add-on



Introduction

I bring a new transition for all rpg makers (yes, compatible with xp, vx and vx ace.)
you only must copy this script over main and read the instructions in the script


Features


  • Easy install

  • Easy command

  • Cool transition if you're bored of the old transitions




Screenshots

no screenshots available.


Demo

no demo available.


Script

XP and VX use this script:
Spoiler: ShowHide
=begin

 SCRIPT CREATED BY NEWOLD
 20-09-2013
 FREE USE
 DESCRIPTION
 
   Displays a transition similar to Paper Mario game in Game Cube
   (Great for use before changing scene!!!)
   
   (You can watch a preview in this video in minute 3:13
   
   http://www.youtube.com/watch?v=RayrWDD7O10
   
   )
   
   
******************************** INSTRUCTION ********************************

Put over main script.

You call this transition using command call script and write this code

---------------------------------------------------------------------------
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

PPT.set(
'image*',
'fx*',
Columns*,Rows*,EventsList*)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------------------------------------------------

and change values marked with * with the following:

--------------------------------------------------------------------------------

- image* : filename of the image to display in your game folder.
You can add an animated image that is divided into several rows and columns
adding at the end the name of the image as follows:

[a number]  (Example: [7]) indicates that the image is divided into
x columns (7 columns in the example)

[a number, other number] (Ejemplo: [7,5]) indicates that the image is divided into
x columns and y rows (7 columns and 5 rows in the example)

examples:

flower      <- image called flower divided into 1 column and 1 row
flower[2]   <- image called flower divided into 2 column and 1 row
flower[2,2] <- image called flower divided into 2 columns and 2 rows

--------------------------------------------------------------------------------

- fx* : filename of the sound to play when each image appear.
(nil if you don't want to put a sound)

--------------------------------------------------------------------------------

- Columns* : Number of columns of images that will be on display

--------------------------------------------------------------------------------

- Rows* : Number of rows of images that will be on display

--------------------------------------------------------------------------------

- EventsList* : List of ids corresponding to events that will be updated
while playing the transition ([ID 1, ID 2, ID 3, ...])

--------------------------------------------------------------------------------


Global Example:

PPT.set(
'Graphics/Pictures/Image01[6,1]',
'Audio/SE/sound01',
5,4,[5,6,1,16])

=end


#==============================================================================
module PPT
 #--------------------------------------------------------------------------
 def PPT.set(image,fx=nil,dH=16,dV=16,events_list=[])
     @fx = fx
     @dH = dH
     @dV = dV
     @max = @dH * @dV
     @x, @y = 0, 0
     @hidden = false
     @sprites = []
     @mode1 = 0
     @mode2 = 0
     @cnt = 1
     @events_list = events_list
     if defined?(Graphics.width) and defined?(Graphics.height)
        @w, @h = Graphics.width, Graphics.height
     else
        @w, @h = 640, 480
     end
     w, h = @w/@dH,@h/@dV
     @modX = (@w - (w * @dH)) / 2
     @modY = (@h - (h * @dV)) / 2
     @b = Bitmap.new(@w/@dH,@h/@dV)
     image.match(/\[(\d+)]|\[(\d+),(\d+)]/)
     unless $2.nil?
        @frameW, @frameH = [$2.to_i,1].max, [$3.to_i,1].max
     else
        @frameW = $1.nil? ? 1 : [$1.to_i,1].max
        @frameH = 1
     end
     begin
        @pattern = Bitmap.new(image)
     rescue => e
        @pattern = Bitmap.new(1,1)
     end
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.stretch_blt(@b.rect,@pattern,rect)
     self.run
  end
  #--------------------------------------------------------------------------
 def PPT.eliminate_sprites
   @showing_sprites = false
   z = 255.0 / @sprites.size
   z2 = 255 - z
   @sprites.reverse.each {|s|
     Audio.se_play(@fx) rescue nil
     @background.opacity = z2
     z2 -= z
     for i in 0...5
       s.zoom_x -= 0.2
       if $scene.is_a?(Scene_Map)
         $scene.update
       end
       Graphics.update
     end
     s.dispose
   }
   @background.dispose; @background = nil;
   @sprites = []
   set_finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.set_finish_process(v=true)
   @finish_process = v
 end  
 #--------------------------------------------------------------------------
 def PPT.showing_sprites?
   return @showing_sprites
 end
 #--------------------------------------------------------------------------
 def PPT.in_process?
   return false if @sprites.nil?
   return @sprites.size > 0
 end
 #--------------------------------------------------------------------------
 def PPT.finish_process?
   return false if @finish_process.nil?
   return @finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.events_list
   return @events_list
 end
 #--------------------------------------------------------------------------
 private
 #--------------------------------------------------------------------------
 def self.run
   @background = Sprite.new
   @background.bitmap = Bitmap.new(@w,@h)
   @background.bitmap.fill_rect(0,0,@w,@h,Color.new(0,0,0))
   @background.z = 50000000
   @background.opacity = 0
   z = (255.0/(@dH*@dV))
   z2 = z
   while @max > 0
       self.create_sprite
       @background.opacity = z2
       z2 += z
       @max -= 1
   end
   @background.opacity = 255
   self.animation_sprites
   @showing_sprites = true
   set_finish_process
 end
  #--------------------------------------------------------------------------
 def self.create_sprite
   Audio.se_play(@fx) rescue nil
   w, h = @w/@dH,@h/@dV
   s = Sprite.new
   s.bitmap = @b
   s.x = @x + @b.width / 2 + @modX
   s.y = @y + @modY
   s.ox = @b.width / 2
   s.zoom_x = 0.2
   s.z = 50000000
   Graphics.update
for i in 0...4
     s.zoom_x += 0.2
     Graphics.update
end
   @sprites << s
   if @mode1 == 0 and @mode2 == 0
     if @cnt == @dH or exist_sprite_in(@x + w,@y)
       @mode2 = 1; @y += h; @cnt = 2
     else
       @x += w; @cnt += 1
     end
   elsif @mode1 == 0 and @mode2 == 1
     if @cnt == @dV or exist_sprite_in(@x,@y+h)
       @mode1 = 1; @x -= w; @cnt = 2
     else
       @y += h; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 1
     if @cnt == @dH or exist_sprite_in(@x - w,@y)
       @mode2 = 0; @y -= h; @cnt = 2
     else
       @x -= w; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 0
     if @cnt == @dV or exist_sprite_in(@x,@y-h)
       @mode1 = 0; @x += w; @cnt = 2
     else
       @y -= h; @cnt += 1
     end
   end
 end
  #--------------------------------------------------------------------------
 def self.exist_sprite_in(x,y)
   @sprites.each {|s| return true if s.x - s.ox - @modX == x and s.y - @modY == y}
   return false
 end
  #--------------------------------------------------------------------------
 def self.animation_sprites
     frameW, frameH = 0, 0
     n = (@frameW > 1 or @frameH > 1) ? 60 : 30
     n.times {
        Graphics.update
        if Graphics.frame_count % 2 == 0
           w = @pattern.width/@frameW * frameW
           h = @pattern.height/@frameH * frameH
           frameW += 1
           if frameW >= @frameW
              frameW = 0
              frameH += 1
              if frameH >= @frameH
                 frameH = 0
              end
           end
           rect = Rect.new(w,h,@pattern.width/@frameW,@pattern.height/@frameH)
           @b.clear
           @b.stretch_blt(@b.rect,@pattern,rect)
        end
     }
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.clear
     @b.stretch_blt(@b.rect,@pattern,rect)
     Graphics.update
 end
  #--------------------------------------------------------------------------
end
#==============================================================================

#==============================================================================
class Game_Event < Game_Character
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   if (PPT.in_process? and PPT.events_list.include?(@id)) or
     not PPT.in_process?
     newUpdateByNewold
   end
 end
end
#==============================================================================

#==============================================================================
if Window_Message.superclass.name == 'Window_Selectable'
 t = "class Window_Message < Window_Selectable;"
else
 t = "class Window_Message < Window_Base"
end
t += "
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   unless PPT.in_process?
     newUpdateByNewold
   end
 end
end"
eval t
#==============================================================================

#==============================================================================
module Graphics
  class << self
     unless defined?(Graphics.updateGraphicsBynewold)
        alias updateGraphicsBynewold update
     end
     def update
       if PPT.showing_sprites?
         PPT.eliminate_sprites
       end
       if PPT.finish_process?
         PPT.set_finish_process(false)
       end
       updateGraphicsBynewold
     end
     unless defined?(Graphics.transitionGraphicsBynewold)
        alias transitionGraphicsBynewold transition
     end
     def transition(*args)
       if PPT.in_process? or PPT.finish_process?
         transitionGraphicsBynewold(0)
       else
         transitionGraphicsBynewold(*args)
       end
     end
     if defined?(Graphics.brightness)
       unless defined?(Graphics.brightnessGraphicsBynewold)
         alias brightnessGraphicsBynewold brightness
       end
       def brightness(*args)
         unless PPT.in_process? or PPT.finish_process?
           brightnessGraphicsBynewold(*args)
         else
           return 0
         end
       end
     end
  end
end
#==============================================================================


VX ACE use this script:
Spoiler: ShowHide
=begin

 SCRIPT CREATED BY NEWOLD
 20-09-2013
 VERSION: ONLY FOR    --  RPG MAKER VX ACE  --
 FREE USE
 DESCRIPTION
 
   Displays a transition similar to Paper Mario game in Game Cube
   (Great for use before changing scene!!!)
   
   (You can watch a preview in this video in minute 3:13
   
   http://www.youtube.com/watch?v=RayrWDD7O10
   
   )
   
   
******************************** INSTRUCTION ********************************

Put over main script.

You call this transition using command call script and write this code

---------------------------------------------------------------------------
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

PPT.set(
'image*',
'fx*',
Columns*,Rows*,EventsList*)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---------------------------------------------------------------------------

and change values marked with * with the following:

--------------------------------------------------------------------------------

- image* : filename of the image to display in your game folder.
You can add an animated image that is divided into several rows and columns
adding at the end the name of the image as follows:

[a number]  (Example: [7]) indicates that the image is divided into
x columns (7 columns in the example)

[a number, other number] (Ejemplo: [7,5]) indicates that the image is divided into
x columns and y rows (7 columns and 5 rows in the example)

examples:

flower      <- image called flower divided into 1 column and 1 row
flower[2]   <- image called flower divided into 2 column and 1 row
flower[2,2] <- image called flower divided into 2 columns and 2 rows

--------------------------------------------------------------------------------

- fx* : filename of the sound to play when each image appear.
(nil if you don't want to put a sound)

--------------------------------------------------------------------------------

- Columns* : Number of columns of images that will be on display

--------------------------------------------------------------------------------

- Rows* : Number of rows of images that will be on display

--------------------------------------------------------------------------------

- EventsList* : List of ids corresponding to events that will be updated
while playing the transition ([ID 1, ID 2, ID 3, ...])

--------------------------------------------------------------------------------


Global Example:

PPT.set(
'Graphics/Pictures/Image01[6,1]',
'Audio/SE/sound01',
5,4,[5,6,1,16])

=end


#==============================================================================
module PPT
 #--------------------------------------------------------------------------
 def PPT.set(image,fx=nil,dH=16,dV=16,events_list=[])
     @fx = fx
     @dH = dH
     @dV = dV
     @max = @dH * @dV
     @x, @y = 0, 0
     @hidden = false
     @sprites = []
     @mode1 = 0
     @mode2 = 0
     @cnt = 1
     @events_list = events_list
     if defined?(Graphics.width) and defined?(Graphics.height)
        @w, @h = Graphics.width, Graphics.height
     else
        @w, @h = 640, 480
     end
     w, h = @w/@dH,@h/@dV
     @modX = (@w - (w * @dH)) / 2
     @modY = (@h - (h * @dV)) / 2
     @b = Bitmap.new(@w/@dH,@h/@dV)
     image.match(/\[(\d+)]|\[(\d+),(\d+)]/)
     unless $2.nil?
        @frameW, @frameH = [$2.to_i,1].max, [$3.to_i,1].max
     else
        @frameW = $1.nil? ? 1 : [$1.to_i,1].max
        @frameH = 1
     end
     begin
        @pattern = Bitmap.new(image)
     rescue => e
        @pattern = Bitmap.new(1,1)
     end
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.stretch_blt(@b.rect,@pattern,rect)
     self.run
  end
  #--------------------------------------------------------------------------
 def PPT.eliminate_sprites
   if @cnt2 > 0
     @cnt2 -= 1; return
   end
   @showing_sprites = false
   z = 255.0 / @sprites.size
   z2 = 255 - z
   @sprites.reverse.each {|s|
     Audio.se_play(@fx) rescue nil
     @background.opacity = z2
     z2 -= z
     for i in 0...5
       s.zoom_x -= 0.2
       if $scene.is_a?(Scene_Map)
         $scene.update
       end
       Graphics.update
     end
     s.dispose
   }
   @background.dispose; @background = nil;
   @sprites = []
   set_finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.set_finish_process(v=true)
   @finish_process = v
 end  
 #--------------------------------------------------------------------------
 def PPT.showing_sprites?
   return @showing_sprites
 end
 #--------------------------------------------------------------------------
 def PPT.in_process?
   return false if @sprites.nil?
   return @sprites.size > 0
 end
 #--------------------------------------------------------------------------
 def PPT.finish_process?
   return false if @finish_process.nil?
   return @finish_process
 end
 #--------------------------------------------------------------------------
 def PPT.events_list
   return @events_list
 end
 #--------------------------------------------------------------------------
 private
 #--------------------------------------------------------------------------
 def self.run
   @background = Sprite.new
   @background.bitmap = Bitmap.new(@w,@h)
   @background.bitmap.fill_rect(0,0,@w,@h,Color.new(0,0,0))
   @background.z = 50000000
   @background.opacity = 0
   z = (255.0/(@dH*@dV))
   z2 = z
   while @max > 0
       self.create_sprite
       @background.opacity = z2
       z2 += z
       @max -= 1
   end
   @background.opacity = 255
   self.animation_sprites
   @showing_sprites = true
   set_finish_process
   @cnt2 = 1
 end
  #--------------------------------------------------------------------------
 def self.create_sprite
   Audio.se_play(@fx) rescue nil
   w, h = @w/@dH,@h/@dV
   s = Sprite.new
   s.bitmap = @b
   s.x = @x + @b.width / 2 + @modX
   s.y = @y + @modY
   s.ox = @b.width / 2
   s.zoom_x = 0.2
   s.z = 50000000
   Graphics.update
for i in 0...4
     s.zoom_x += 0.2
     Graphics.update
end
   @sprites << s
   if @mode1 == 0 and @mode2 == 0
     if @cnt == @dH or exist_sprite_in(@x + w,@y)
       @mode2 = 1; @y += h; @cnt = 2
     else
       @x += w; @cnt += 1
     end
   elsif @mode1 == 0 and @mode2 == 1
     if @cnt == @dV or exist_sprite_in(@x,@y+h)
       @mode1 = 1; @x -= w; @cnt = 2
     else
       @y += h; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 1
     if @cnt == @dH or exist_sprite_in(@x - w,@y)
       @mode2 = 0; @y -= h; @cnt = 2
     else
       @x -= w; @cnt += 1
     end
   elsif @mode1 == 1 and @mode2 == 0
     if @cnt == @dV or exist_sprite_in(@x,@y-h)
       @mode1 = 0; @x += w; @cnt = 2
     else
       @y -= h; @cnt += 1
     end
   end
 end
  #--------------------------------------------------------------------------
 def self.exist_sprite_in(x,y)
   @sprites.each {|s| return true if s.x - s.ox - @modX == x and s.y - @modY == y}
   return false
 end
  #--------------------------------------------------------------------------
 def self.animation_sprites
     frameW, frameH = 0, 0
     n = (@frameW > 1 or @frameH > 1) ? 60 : 30
     n.times {
        Graphics.update
        if Graphics.frame_count % 2 == 0
           w = @pattern.width/@frameW * frameW
           h = @pattern.height/@frameH * frameH
           frameW += 1
           if frameW >= @frameW
              frameW = 0
              frameH += 1
              if frameH >= @frameH
                 frameH = 0
              end
           end
           rect = Rect.new(w,h,@pattern.width/@frameW,@pattern.height/@frameH)
           @b.clear
           @b.stretch_blt(@b.rect,@pattern,rect)
        end
     }
     rect = Rect.new(0,0,@pattern.width/@frameW,@pattern.height/@frameH)
     @b.clear
     @b.stretch_blt(@b.rect,@pattern,rect)
     Graphics.update
 end
  #--------------------------------------------------------------------------
end
#==============================================================================

#==============================================================================
class Game_Event < Game_Character
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   if (PPT.in_process? and PPT.events_list.include?(@id)) or
     not PPT.in_process?
     newUpdateByNewold
   end
 end
end
#==============================================================================

#==============================================================================
if Window_Message.superclass.name == 'Window_Selectable'
 t = "class Window_Message < Window_Selectable;"
else
 t = "class Window_Message < Window_Base"
end
t += "
 unless defined?(newUpdateByNewold)
   alias newUpdateByNewold update
 end
 def update
   unless PPT.in_process?
     newUpdateByNewold
   end
 end
end"
eval t
#==============================================================================

#==============================================================================
if Scene_Map.superclass.name == "Scene_Base"
 class Scene_Map < Scene_Base
   def fade_loop(duration)
     return if PPT.showing_sprites?
     duration.times do |i|
       yield 255 * (i + 1) / duration
       update_for_fade
     end
   end
   def update
     super
     $game_map.update(true)
     $game_player.update
     $game_timer.update
     @spriteset.update
     update_scene if scene_change_ok?
     if PPT.showing_sprites?
       PPT.eliminate_sprites
     end
   end
 end
end
#==============================================================================

#==============================================================================
class Game_Player < Game_Character
 attr_reader :transferring
end
#==============================================================================

#==============================================================================
module SceneManager
 def SceneManager.scene?
   return @scene
 end
end
#==============================================================================

#==============================================================================
module Graphics
  class << self
     unless defined?(Graphics.updateGraphicsBynewold)
        alias updateGraphicsBynewold update
     end
     def update(force_old_update=false)
       if force_old_update
         updateGraphicsBynewold
         return
       end
       if PPT.showing_sprites? and (not $game_player.transferring or
         $game_player.transferring.nil?) and SceneManager.scene?.nil?
         PPT.eliminate_sprites
       end
       if PPT.finish_process?
         PPT.set_finish_process(false)
       end
       updateGraphicsBynewold
     end
     unless defined?(Graphics.transitionGraphicsBynewold)
        alias transitionGraphicsBynewold transition
     end
     def transition(*args)
       if PPT.in_process? or PPT.finish_process?
         transitionGraphicsBynewold(0)
       else
         transitionGraphicsBynewold(*args)
       end
     end
     if defined?(Graphics.brightness)
       unless defined?(Graphics.brightnessGraphicsBynewold)
         alias brightnessGraphicsBynewold brightness
       end
       def brightness(*args)
         unless PPT.in_process? or PPT.finish_process?
           return 0
         else
           brightnessGraphicsBynewold(*args)
         end
       end
     end
  end
end
#==============================================================================




Instructions

Put over main and read the instructions in the script.


Compatibility


  • VX ACE only work with transitions between maps, not transition from map - to menu.

  • VX transition between menus and map not is perfect



Credits and Thanks


  • I'm the script creator so, thanks at me ;)




Author's Notes

Enjoy it!
7
Hi, i want SHBrowseForFolder function in my RGSS, i have this code:

# =============================================================================
module SHBrowseForFolder# by Newold
 #--------------------------------------------------------------------------
 # Open finder folder dialog
 SHBrowseForFolder = Win32API.new('shell32', 'SHBrowseForFolder', 'p', 'l')
 # Get path
 SHGetPathFromIDList = Win32API.new('shell32', 'SHGetPathFromIDList', 'lp', 'l')
 # send msg
 SendMessage       = Win32API.new('User32','SendMessage','lllp','l')
 # last dir checked
 @pidlRoot = 0
 @lastBuffer = ""
 #--------------------------------------------------------------------------
 module_function
 #--------------------------------------------------------------------------
 def new(hWndOwner=0,pIDLRoot=0,pszDisplayName="\0" * 260,
   lpszTitle="Select Folder with a RPG Maker proyect:",
   ulFlags=0,lpfnCallback=nil,lParam=0,iImage=-1)
   begin
     buffer = "\0" * 260
     browseInfo = [hWndOwner.to_i,pIDLRoot.to_i,pszDisplayName,
     lpszTitle,ulFlags.to_i,lpfnCallback,lParam.to_i,
     iImage.to_i].pack("llpplpll")
     @pidlRoot = idList = SHBrowseForFolder.(browseInfo) rescue 0
     return false if idList == 0
     SHGetPathFromIDList.(idList,buffer)
     buffer.delete!("\0")
     @lastBuffer = buffer.dup
     buffer.gsub!("\\","/")
     unless buffer.match(/\/$/) or buffer.size == 0
       buffer << '/'
     end
     return buffer
   rescue Exception => e
     return ''
   end
 end
 #--------------------------------------------------------------------------
 def lastPID
   return @pidlRoot
 end
 #--------------------------------------------------------------------------
end
# =============================================================================


I can get a path from dir with this, (DIR = SHBrowseForFolder.new) but i dont know how set initial dir in find folder dialog.

I know i have to pass a BrowseCallbackProc  at param lpfnCallback in my function

def browseCallbackProc(hwnd, uMsg, lParam, lpData)
   case uMsg
   when BFFM_INITIALIZED
     if(lpData)
       SendMessage.(hwnd, BFFM_SETSELECTION, 1, lpData);
     end
   when BFFM_SELCHANGED
   when BFFM_VALIDATEFAILED
   else
   end
   return 0;
 end


As I do then to set a default directory, for example "c:\ program files"

I have another problem. When i call finder folder dialog i need to use a rescue because some times, after you select a folder and press ok button, it go to crash and i dont know why :(
8
Hi all. See if you can help me.

FirstQuestion

I have a function in C for a dll.

 DllImport float sum (float a, float b)
{
     return a + b;
}


How do I give to that function float values ​​from RGSS?
My code in RGSS (i cant use 'f' or 'd' as param):

 n = Win32API.new ('test', 'sum', 'ii', 'i')
a = 5.10
b = 8.90
n.call p (a, b)


Last Question

I defined a point class in RGSS

class Point # by Newold
  #--------------------------------------------------------------------------
  attr_accessor   :x
  attr_accessor   :y
  #--------------------------------------------------------------------------
  def initialize(x=0,y=0)
    @x = x; @y = y
  end
  #--------------------------------------------------------------------------
end


in dll i defined this struct:

struct point
{
    float x;
    float y;
};


How do I give to a function a point ​​from RGSS? i want say, If i have this point in RGSS => Point.new(150,150), how i pass this point to a function in c as struct point.
9
NOTE EDITOR
Authors: NEWOLD
Version: 1.1
Type: Database Notes Editor for RPG MAKER XP
Key Term: Scripting Tool



Introduction

This editor lets you create notes for almost any data from the database in RPG MAKER XP. These notes can be used by other scripts in a simple (as in RPG MAKER VX and ACE)


Features


  • create notes for almost any data from the database in RPG MAKER XP (maps, common events, armors, items, elements, states...)




Screenshots




Demo

http://www.megaupload.com/?d=W0JR9B2Y dead forever?
http://www.mediafire.com/?21pvvlrpb3q6r30 Working


Script

None.


Instructions

1) Download Editor: http://www.megaupload.com/?d=W0JR9B2Y or http://www.mediafire.com/?21pvvlrpb3q6r30
2) Unzip the editor and put it in a valid RPG MAKER XP Project.
3) Run it to Edit notes from data in database (Use the 'Expand DataBase Editor.exe' to edit the notes of the different data).
4) How to access the notes in game:

* Actors:         $data_actors[ID].note
* Clases:              $data_classes[ID].note
* Skills:                $data_skills[ID].note
* Items:               $data_items[ID].note
* Weapons:          $data_weapons[ID].note
* Armors:         $data_armors[ID].note
* States:             $data_states[ID].note
* Elements:          element_note[ID]
* Enemies:           $data_enemies[ID].note
* Troops:         $data_troops[ID].note
* Animations:        $data_animations[ID].note
* Tile Sets:           $data_tilesets[ID].note
* Common Events:  $data_common_events[ID].note
* Maps:                map_note[ID]



Compatibility

None.


Credits and Thanks


  • Me ;)




Author's Notes

The text of the notes can contain line breaks represented by \n.

Comment if you like, and if not too  :naughty:
10
MULTI-LANGUAJE
Authors: NEWOLD
Version: 1.0
Type: Script to help the translation of a project in multiple languages
Key Term: Message Add-on



Introduction

This script is designed so you can keep the text that appears in your project in a separate text file, so you can quickly change the texts and / or put them in another language



Features

  • The text file can have comments for a better understanding (comments start with #).

  • You can create very large messages (if message has more four lines, it be splitted in several messages of four lines each).

  • You can use the commands you use with the Message System you use.

  • You can use any type of ID (text / number) to identify the messages in the file lang.

  • You can translate any word in the database too ;)




Screenshots

No representative screen shots.


Demo

No demo at the moment. Sorry!


Script

Scripts very long, you can download it from here:

http://www.megaupload.com/?d=15WPNUXZ



Instructions


  • Place the SCRIPT 1 on top.

  • Place the SCRIPT 2 under SCRIPT 1.

  • Only if you use the RPG Maker XP - Place the SCRIPT 3 over main script.

  • Only if you use the RPG Maker VX - Place the SCRIPT 4 over main script.

  • Place the SCRIPT 5 over main script.

  • Create a folder in your project folder and call it Lang.

  • Inside the folder Lang create a file with the name lang.ini

  • Open the file lang.ini with text editor and type in lang = eng

  • Create other file in Lang folder named as you put in file lang.ini ending in .lang (Ex: eng.lang).
    The structure of the text file is as follows: (ID::Text)
    Ex:

    1::Text 1
    # Comment 1
    ID Text2::Text 2
    3::Text 3 # Comment 2
    # Comment 3
    4:: Text 4, line 1
    Text 4, line 2
    Text4, line X
    1000000::Text 1000000


  • Create multiple files as above for each language.

  • Go to the initialize method of the script SCRIPT 1 and configured as specified in the same

  • Put the pictures of the flags in the Lang folder of your proyect

  • all Ready ;)



With a command Show Text in events, you can use now \lang[id Message] for show the message with that ID.

In database you can use now \lang[ID Text] in each fild name or comment



Compatibility

Found no compatibility issues.


Credits and Thanks


  • me ;)




Author's Notes

You can download a pack with two flags (English and Spanish flag) from here:

http://www.megaupload.com/?d=2KH57WWK or
http://www.mediafire.com/?ccsw9wiy2iv6izu
11
RPG Maker Scripts / [XP]New Editor - By me ;)
November 01, 2011, 12:36:03 pm
Hello to everyone. I've started a new project to recreate / extend the editor that comes with the RPG Maker XP. This Editor is done completely on RGSS (interested in the source code, ask me by private and give you the link where it is posted).

Everything is in Spanish but you can also download and try it. I need translators to translate it into English. I also need scripters interested in joining the project and provide ideas).

To test the editor, download the file and unzip it. Copy the file 'New Editor.exe' to your project (you should make a backup before this step). The editor 'RPG MAKER XP' must be closed to run the 'New Editor.exe'. Then, run the file 'New Editor.exe' to test the editor (The current version of the editor is Alpha 0.3)

You can download my Editor from:

Megaupload: http://www.megaupload.com/?d=9489MAFU

Mediafire: http://www.mediafire.com/?9rbllqa2d5a816h

Others Servers: http://www.multiupload.com/87GIJZKWVT


Preview Video





PS: Post translated into English from google translator.

Sorry for grammatical errors;)

If you find a bug post it so I can fix it, thanks ;)
12
Viewport_Mask
Authors: Newold
Version: 1.0
Type: VIEWPORT ADDON
Key Term: Misc Add-on



Introduction

With this script you can use viewports non-reactangular (Circle viewport for example)


Features


  • Create viewports non-rectangular easily

  • You can animate bitmap in this viewports as planes (see example in demo)




Screenshots




Demo

Demo for XP:

http://www.megaupload.com/?d=C7X9YH09 or
http://www.mediafire.com/?ivda939v8ba5mvy


Demo for VX:

http://www.megaupload.com/?d=GMMPHMZR or
http://www.mediafire.com/?zb4ebkcp4asaqzb



Script



Instructions

The instructions are in spanish in the script, (the script in the demo is called **Masks**) here I put the instruction in english (google translate and superviced by me,  but may contain errors in grammar). You can to put this script anywhere in the script's editor in your project

Instructions translate in English
=begin 

 -------------------------------------------------- ---------------------------
 By newold
 08/10/2011
 -------------------------------------------------- ---------------------------
 
 This script will create viewport for sprites in any way
 (circle, triangle, irregular polygon...).
 
 -------------------------------------------------- ---------------------------
 
 Use:
 
 The script load images from folder that will contain viewport-mask.
 (Any non-transparent part of these images will be deleted on the image
 sprite)
 
 Once you've created your sprite and you've assigned a picture, you can apply
 this new viewport like this:
 
 your_sprite.mask = Viewport_Mask.new ("Name of pattern of the viewport")
 
 Automatically, the image of the sprite will be resized to size of the image
 pattern, and it will look as form of the pattern.
 
 To move the image on the new viewport, use this command:
 
 your_sprite.ani_mask(Speed X, Speed Y)
 
 the image will move as if it were a plane
 
 ******************************************************************************
 Tutorial to create pattern in Photoshop:
 ******************************************************************************
 1 - Create a new image.
 2 - Draw the desired shape of the viewport with a solid color
     (Eg: #000000)
 3 - Once created the pattern, you pressed press "Left click" on
     the image in the layers palette with "CTRL" pressed, to select your pattern.
 4 - Press "delete/Back" to delete the pattern.
 5 - Press CTRL + SHIFT + I to invert the selection
 6 - Take the paint with a solid color (Eg: #000000)
 7 - Fill the selection
 8 - Save the pattern as png in the pictures folder of your game
 9 - Now you can use this pattern to create a viewport with him.
 ******************************************************************************
 
 
=end



Compatibility

100% compatible with XP and VX


Credits and Thanks


  • me  8)




Author's Notes

I leave to your imagination the use that you could to give to this script in yours proyects... (circle mini-maps perhaps?)

PS: sorry for the grammar and spelling mistakes  :^_^':
13
ok, i do this code in C in visual studio:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClassLibrary1
{
   public class Sum
   {
       public double SumNumber(double num1, double num2)
       {
           return num1 + num2;
       }
   }

   
}


now, in rpg maker, i try use the dll as well

Win32API.new('ClassLibrary1','SumNumber','ll','l')


but i get error: GetProcAddress: SumNumber or SumNumberA

so i think my code is missing something.


Question:

Someone know that code I need to put in the DLL to avoid that error?

Question 2

Someone could put the code in the dll to build a "Hello World!" and in the RPG maker call this as well

helloworld= Win32API.new('HelloWorld','talkme','','P')
p helloworld.call   => Hello World!

thanks all and sorry for my english :D

PS) These examples serve me long to start building some dll that I have thought
14
RMXP Script Database / [XP] Component Shop
April 27, 2011, 06:09:26 am
Component Shop
Authors: Newold
Version: 1.0
Type: Custom Shop
Key Term: Custom Shop System



Introduction

Use this script for build a shop by component. (You need X materials for buy a particular Item/Weapon/Armor)


Features


  • Completely configurable item requirements for every item/Weapon,Armor




Screenshots




Demo

none.


Script

Download scripts + Images + Instruction


Instructions

instructions are in the script.


Compatibility

None.


Credits and Thanks


  • Myself ;)




Author's Notes

You can change the graphics using others images.
To change color set, you must search in the script the color codes (Color.new) and change it manually
You can change de words in menu in the configuration section in the script
15
Displacement Bar in Windows
Authors: Newold
Version: 1.2
Type: Windows decoration
Key Term: Misc System



Introduction

This script is useful for adding a vertical scroll bar on the windows, as the windows in Windows SO


Features


  • You can change the color and position of bars

  • You can to use an image for the bars

  • You can hide the bar




Screenshots

 


Demo

none.


Script

Spoiler: ShowHide

=begin

 *****************************************************************************
 ESTE SCRIPT AÑADE UNA BARRA DE SCROLL VERTICAL A LAS VENTANAS EN CASO DE QUE
 SU CONTENDIO SEA MAYOR QUE LA VENTANA (COMO LAS VENTANAS DEL WINDOWS)
 
 CREADOR: NEWOLD
 FECHA: 15-04-2011
 VERSIÓN: 1.2, Compatible Con PRG Maker XP y VX
 
 Cambios versión 1.1: Ahora también pueden usar imágenes custom :D
 Cambios en la versión 1.2: Añadido unas cuantas sombras más y la  posibilidad
                            de ocultar el adorno de las barras
 
 *****************************************************************************
 
 *****************************************************************************
 INSTRUCCIONES
 *****************************************************************************
 
 - Las ventanas creadas tendrán por defecto la barra de scroll habilitada.
   Para cambiar esto, usar este comando:
       
       tuVentana.scroll_bar_visible = *valor*
     
     # *valor* = false  /  true  => DESACTIVAR /  ACTIVAR
 
 - La barra sale por defecto situada a la izquierda de la ventana.
   Para cambiar esto, usar este comando:
   
       tuVentana.scroll_bar_position = *valor*
     
     # *valor* = 0  /  1  => IZQUIERDA /  DERECHA
     
 - Las barras son creadas con unos colores por defecto.
   Para cambiar esto, usar estos comandos:
   
     # Cambiar el color del fondo de la barra
     
       tuVentana.scroll_bar_background_color = *color*
       
     # Cambiar el color del borde del fondo de la barra
     
       tuVentana.scroll_bar_background_borde_color = *color*
       
     # Cambiar el color de la barra de desplazamiento
     
       tuVentana.scroll_bar_top_color = *color*
       
     # Cambiar el color del borde de la barra de desplazamiento
     
       tuVentana.scroll_bar_top_borde_color = *color*
       
     # Cambiar el color del adorno encima de la barra de desplazamiento
     
       tuVentana.scroll_bar_decoration_color = *color*
       
     # Cambiar el color del sombreado de la barra de desplazamiento y adorno

       tuVentana.shadow_color = *color* # Sombreado 1
       
       tuVentana.shadow_color2 = *color* # Sombreado 2
       
       tuVentana.shadow_color3 = *color* # Sombreado 3
       
   # *color* = Color.new(*red*,*green*,*blue*,*alpha*)
   
       # *red*,*green*,*blue*,*alpha* = un valor entre 0 y 255
       
 - Si usas cualquier comando anterior usa también este comando para que
   se actualizen los cambios
   
      tuVentana.refresh_bars
     
 - Alternativamente, puedes usar una imagen para generar las barras.
   Para ello, usa este comando:
   
      tuVentana.use_custom_images = *image*
     
   *image* = El nombre de la imagen de la barra de desplazamiento.
             Esta imagen debe estar en la carpeta picture de tu juego.
             no te olvides de usar el comando
             
                 tuVentana.refresh_bars
                 
             para aplicar los cambios a tu ventana
             
 (Usa la imagen que acompaña al script para guiarte a la hora de crear
  tus propias barras :D.)
 
 - Por último, puedes usar este comando para que se dibuje o no el adorno
   en la barra de scroll (por defecto está activado que se vea)
   
       tuVentana.hide_decoration = *valor*
       
     # *valor* = false  /  true  => DESACTIVAR /  ACTIVAR
 
 *****************************************************************************
 
=end

#==============================================================================
class Window
 #--------------------------------------------------------------------------
 attr_accessor :scroll_bar_visible, :scroll_bar_background_color,
               :scroll_bar_background_borde_color,
               :scroll_bar_top_color, :scroll_bar_top_borde_color,
               :scroll_bar_decoration_color, :scroll_bar_position,
               :shadow_color,  :shadow_color2, :shadow_color3,
               :use_custom_images, :hide_decoration
 #--------------------------------------------------------------------------
 alias initialize_bynewold initialize
 def initialize
   initialize_bynewold
   @scroll_bar_visible = true
   @scroll_bar_background_color = Color.new(240,240,240,255)
   @scroll_bar_background_borde_color = Color.new(255,255,255,255)
   @scroll_bar_top_color = Color.new(205,205,209,255)
   @scroll_bar_top_borde_color = Color.new(0,0,0,255)
   @scroll_bar_decoration_color = Color.new(130,130,130,255)
   @shadow_color = Color.new(255,255,255,255)
   @shadow2_color = Color.new(255,255,255,255)
   @shadow3_color = Color.new(110,103,94,255)
   @scroll_bar_position = 0 # 0 = Izquierda  ||  1 = Derecha
   @use_custom_images = ''
   @hide_decoration = true
 end
 #--------------------------------------------------------------------------
 alias update_bynewold update
 def update
   update_bynewold
   if @background_bar != nil
     # Ocultar o mostrar la barra según sea pertinente
     if !self.visible
       @background_bar.visible = false
       @top_bar.visible = false
     else
       if @scroll_bar_visible
         @background_bar.visible = true
         @top_bar.visible = true
       else
         @background_bar.visible = false
         @top_bar.visible = false
       end
     end
     # Mover la barra de scroll a su lugar correspondiente
     # Comprobar si el maker es el xp o el vx y establecer unos valores
     if defined?(Cache)
       mod_height = 24
       mod_y = 10
       mody2 = 4
     else
       mod_height = 32
       mod_y = 8
       mody2 = 0
     end
     # Cálculos para saber donde debe estar la barra de escroll
     des_real_barra = @background_bar.bitmap.height -
       @top_bar.bitmap.height - mod_y
     des_real_barra = mod_height if des_real_barra < mod_height
     des_real_content = self.contents.height - self.height
     des_real_content = 1 if des_real_content < 1
     y_desplazamiento = (self.oy * des_real_barra / des_real_content)
     @top_bar.y = self.y + 5 + y_desplazamiento - ((mod_y-2)-6) + mody2
     if @top_bar.y + @top_bar.bitmap.height >
        @background_bar.y + @background_bar.bitmap.height - 2
       @top_bar.y = @background_bar.y + @background_bar.bitmap.height -
         2 - @top_bar.bitmap.height
     end
     # Otros datos a actualizar
     @background_bar.z = self.z + 1
     @top_bar.z = self.z + 2
   elsif self.visible and self.contents != nil and @background_bar == nil and
     @scroll_bar_visible == true
     create_vertical_bar
   end
 end
 #--------------------------------------------------------------------------
 def create_vertical_bar
   # ----------------------------------------------------------
   return if self.contents == nil or
     self.contents.height <= self.height - 32 or
     self.visible == false or
     @scroll_bar_visible == false
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Comprobar si el maker es el xp o el vx y establecer unos valores
   if defined?(Cache)
     mod_height = 24
     mod_height2 = 2
     mod_y = 10
     mody2 = 4
     mod_x = 2
     mod_height_scroll_bar = 10
   else
     mod_height = 32
     mod_height2 = 0
     mod_y = 8
     mody2 = 0
     mod_x = 0
     mod_height_scroll_bar = 5
   end
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Calcular el tamaño vertical que debería tener la barra de scroll
   vertical_size = self.height - mod_y - 2 # Tamaño completo
   # Ajustar el tamaño con respecto a la cantidad de datos disponibles
   data_size = (self.contents.height / mod_height) * 4
   vertical_size -= data_size - mod_height_scroll_bar
   # Comprobar si el tamaño de la barra es inferior a 8 y ajustarlo a 8
   vertical_size = 8 if vertical_size < 8
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   if @background_bar == nil
     # background...........................................
     @background_bar = Sprite.new
     @background_bar.bitmap = Bitmap.new(11,self.height-mod_y-mod_height2)
     @background_bar.y = self.y + 4 + (mod_y-8)
     # .....................................................
     # top..................................................
     @top_bar = Sprite.new
     @top_bar.bitmap = Bitmap.new(9,vertical_size)
     @top_bar.y = self.y + 5 + (8-mod_y) + mody2
     # .....................................................
   else
     @background_bar.bitmap.clear
     @top_bar.bitmap.clear
   end
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Posicionar las barras en el eje X
   if @scroll_bar_position == 0
     @background_bar.x = self.x + 4 + mod_x
     @top_bar.x = self.x + 5 + mod_x
   else
     @background_bar.x = self.x + self.width - 15 - mod_x
     @top_bar.x = self.x + self.width - 14 - mod_x
   end
   # ----------------------------------------------------------
   if @use_custom_images != ''
     rects = [
     # background
     Rect.new(1,1,11,4), # top
     Rect.new(1,17,11,4), # bottom
     Rect.new(1,4,11,12), # middle
     # top
     Rect.new(15,1,10,4), # top
     Rect.new(15,17,10,4), # bottom
     Rect.new(15,4,10,12), # middle
     # decoration
     Rect.new(27,7,5,8)
     ]
     # Aplicar la imagen a las barras
     if defined?(Cache)
       b = Cache.picture(@use_custom_images) # Para VX
     else
       b = RPG::Cache.picture(@use_custom_images) # Para XP
     end
     # Dibujar el background....
     h = @background_bar.bitmap.height
     w = @background_bar.bitmap.width
     @background_bar.bitmap.blt(0,0,b,rects[0]) # top
     @background_bar.bitmap.blt(0,h-rects[1].height,b,rects[1]) # bottom
     dest_rect = Rect.new(0,rects[0].height,w,h-rects[0].height-rects[1].height)
     @background_bar.bitmap.stretch_blt(dest_rect,b,rects[2]) # middle
     # Dibujar la barra de scroll...
     h = @top_bar.bitmap.height
     w = @top_bar.bitmap.width
     @top_bar.bitmap.blt(0,0,b,rects[3]) #top
     @top_bar.bitmap.blt(0,h-rects[4].height,b,rects[4]) # bottom
     dest_rect = Rect.new(0,rects[3].height,w,h-rects[3].height-rects[4].height)
     @top_bar.bitmap.stretch_blt(dest_rect,b,rects[5]) # middle
     # Dibujar el adorno en la barra de scroll centrado...
     if @hide_decoration == false
       x = (w / 2) - (rects[6].width / 2)
       y = (h / 2) - (rects[6].height / 2)
       @top_bar.bitmap.blt(x,y,b,rects[6]) # Adorno
     end
     return
   end
     

   # ----------------------------------------------------------
   # Creación del fondo de la barra
   @background_bar.bitmap.fill_rect(0,0,11,self.height-mod_y-mod_height2,
                                    @scroll_bar_background_borde_color)
   @background_bar.bitmap.fill_rect(1,1,9,self.height-mod_y-2-mod_height2,
                                    @scroll_bar_background_color)

   # Redondear la imagen:
   color = Color.new(0,0,0,0) # Color transparente
   # Borde Superior
   @background_bar.bitmap.fill_rect(0,0,2,1,color)
   @background_bar.bitmap.fill_rect(9,0,2,1,color)
   @background_bar.bitmap.fill_rect(0,1,1,1,color)
   @background_bar.bitmap.fill_rect(10,1,1,1,color)
   # añadir el borde faltante...
   @background_bar.bitmap.fill_rect(1,1,1,1,@scroll_bar_background_borde_color)
   @background_bar.bitmap.fill_rect(9,1,1,1,@scroll_bar_background_borde_color)
   # Borde Inferior
   h = @background_bar.bitmap.height
   @background_bar.bitmap.fill_rect(0,h-1,2,1,color)
   @background_bar.bitmap.fill_rect(9,h-1,2,1,color)
   @background_bar.bitmap.fill_rect(0,h-2,1,1,color)
   @background_bar.bitmap.fill_rect(10,h-2,1,1,color)
   # añadir el borde faltante...
   @background_bar.bitmap.fill_rect(1,h-2,1,1,@scroll_bar_background_borde_color)
   @background_bar.bitmap.fill_rect(9,h-2,1,1,@scroll_bar_background_borde_color)
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Crear la barra de desplazamiento
   @top_bar.bitmap.fill_rect(0,0,9,vertical_size,
                                    @scroll_bar_top_borde_color)
   @top_bar.bitmap.fill_rect(1,1,7,vertical_size-2,
                                    @scroll_bar_top_color)
   # Redondear la imagen:
   color = Color.new(0,0,0,0) # Color transparente
   # Borde Superior
   @top_bar.bitmap.fill_rect(0,0,2,1,color)
   @top_bar.bitmap.fill_rect(7,0,2,1,color)
   @top_bar.bitmap.fill_rect(0,1,1,1,color)
   @top_bar.bitmap.fill_rect(8,1,1,1,color)
   # añadir el borde faltante...
   @top_bar.bitmap.fill_rect(1,1,1,1,@scroll_bar_top_borde_color)
   @top_bar.bitmap.fill_rect(7,1,1,1,@scroll_bar_top_borde_color)
   # Borde Inferior
   h = @top_bar.bitmap.height
   @top_bar.bitmap.fill_rect(0,h-1,2,1,color)
   @top_bar.bitmap.fill_rect(7,h-1,2,1,color)
   @top_bar.bitmap.fill_rect(0,h-2,1,1,color)
   @top_bar.bitmap.fill_rect(8,h-2,1,1,color)
   # añadir el borde faltante...
   @top_bar.bitmap.fill_rect(1,h-2,1,1,@scroll_bar_top_borde_color)
   @top_bar.bitmap.fill_rect(7,h-2,1,1,@scroll_bar_top_borde_color)
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Crear el sombreado para la barra de scroll
   @top_bar.bitmap.fill_rect(1,2,2,h-4,@shadow_color)
   color = @shadow_color.dup
   
   color.alpha = @shadow_color.alpha / 2
   bitmap = Bitmap.new(1,h-4)
   bitmap.fill_rect(bitmap.rect,color)
   @top_bar.bitmap.blt(1,1,bitmap,bitmap.rect)
 
   color.alpha = @shadow_color.alpha / 2
   bitmap = Bitmap.new(1,h-4)
   bitmap.fill_rect(bitmap.rect,color)
   @top_bar.bitmap.blt(3,2,bitmap,bitmap.rect)
   
   color = @shadow2_color.dup
   
   color.alpha = @shadow2_color.alpha / 2
   bitmap = Bitmap.new(1,h-4)
   bitmap.fill_rect(bitmap.rect,color)
   @top_bar.bitmap.blt(2,2,bitmap,bitmap.rect)
   
   color = @shadow3_color.dup
   
   color.alpha = @shadow3_color.alpha / 2
   bitmap = Bitmap.new(1,h-4)
   bitmap.fill_rect(bitmap.rect,color)
   @top_bar.bitmap.blt(5,2,bitmap,bitmap.rect)
   
   color.alpha = @shadow3_color.alpha / 2
   bitmap = Bitmap.new(1,h-4)
   bitmap.fill_rect(bitmap.rect,color)
   @top_bar.bitmap.blt(7,2,bitmap,bitmap.rect)
   # ----------------------------------------------------------
   
   # ----------------------------------------------------------
   # Crear el adorno de la barra de scroll
   if vertical_size > 8 and @hide_decoration == false
     bitmap = Bitmap.new(5,8)
     bitmap.fill_rect(0,0,5,1,@scroll_bar_decoration_color)
     bitmap.fill_rect(0,1,5,1,@shadow_color)
     bitmap.fill_rect(0,2,5,1,@scroll_bar_decoration_color)
     bitmap.fill_rect(0,3,5,1,@shadow_color)
     bitmap.fill_rect(0,4,5,1,@scroll_bar_decoration_color)
     bitmap.fill_rect(0,5,5,1,@shadow_color)
     bitmap.fill_rect(0,6,5,1,@scroll_bar_decoration_color)
     bitmap.fill_rect(0,7,5,1,@shadow_color)
     # Dibujar este adorno en el centro de la barra
     x = (@top_bar.bitmap.width  / 2)  - (bitmap.width  / 2)
     y = (@top_bar.bitmap.height / 2)  - (bitmap.height / 2)
     @top_bar.bitmap.blt(x,y,bitmap,bitmap.rect)
   end
   # ----------------------------------------------------------
   
 end
 #--------------------------------------------------------------------------
 def refresh_bars
   if @background_bar != nil
     @background_bar.dispose
     @background_bar = nil
     @top_bar.dispose
     @top_bar = nil
   end
   create_vertical_bar
 end
 #--------------------------------------------------------------------------
 alias dispose_bynewold dispose
 def dispose
   dispose_bynewold
   if @background_bar != nil
     @background_bar.dispose
     @top_bar.dispose
   end
 end
 #--------------------------------------------------------------------------
end
#==============================================================================



Instructions

The instructions in the script are in spanish, here are translated for a program

Spoiler: ShowHide
- the created windows will have the bar of scroll habilitated by default.
   In order to change this, to use this command:

       YourWindow.scroll_visible_bar  = *valor*

     # *valor* = false / true  => DEACTIVATING / ACTIVATE

 - the bar comes out by default placed to the left of the window.
   In order to change this, to use this command:

       YourWindow.scroll_bar_position  = *valor *

     # *valor *  = 0 / 1 => LEFT / RIGHT

 - bars are made with some colors by default.
   In order to change this, to use these commands:

     # Changing the color of the bottom of the bar

       YourWindow.scroll_bar_background_color = *color*

     # Changing the color of the border of the bottom of the bar

       YourWindow.scroll_bar_background_borde_color = *color*

     # Changing the color of the scroll bar

       YourWindow.scroll_bar_top_color = *color*

     # Changing the color of the border of the scroll bar

       YourWindow.scroll_bar_top_borde_color = *color*

     # Changing the color of the adornment on the scroll bar

       YourWindow.scroll_bar_decoration_color = *color*

     # Changing the color of the shading of the scroll bar and adornment

       YourWindow.shadow_color = *color* # Shadow 1

       YourWindow.shadow_color2 = *color* # Shadow 2

       YourWindow.shadow_color3 = *color* # Shadow 3

   # *color* = Color.new(*red*,*green*,*blue*,*alpha*)

       # *red*,*green*,*blue*,*alpha* = val between 0 and 255

 - if you use any previous command you use also this command stops than
   Himself actualizen changes

      YourWindow.refresh_bars

 - alternatively, you can use an image to generate bars.
   For it, use this command:

      YourWindow.use_custom_images = *image*

   *image * = The name of the image of the scroll bar.
             This image must be in the folder picture of your game.
             Do not forget to use the command

                 YourWindow.refresh_bars

             In order to apply the changes to your window

 ( use the pattern image that goes with the script :d.)

 - finally, you can use this command in order that you appear vaguely or no the adornment
   In scroll's bar ( by default the fact that you see yourself is activated )

       YourWindow.hide_decoration = *valor*
       
     # *valor* = false  /  true  => DEACTIVATE /  ACTIVATE



Compatibility

none.


Credits and Thanks


  • Myself ;)




Author's Notes

this is the pattern image for the scroll bars



or you can download from here :D

and this is my first script in the  forum  8), tomorrow more  :P
16
Welcome! / hy all!
April 26, 2011, 11:07:22 am
hy all, i am scripter from spain and i go to post some scripts myself ;)

My english is not very good and my scripts have instructions in Spanish, but i use a program for translate it in english for you,

greetings!