Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Use iconsets in XP, Ever wanted to use VX iconsets in XP, now you can
Legacy
post Feb 18 2010, 11:12 PM
Post #1


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




VX iconsets in XP - by LegACy
Version 1.0


Description:
This little snippet allows you to use IconSets instead of single files for icons, just like VX. Easy to install and easy to use.

Compatibility:
no issues so far.

Screenshots:


Instructions:

Place above main, and above any custom scripts. So, place under Scene_Debug.

to use follow this syntax: draw_icon(file_name, icon_index, x, y)
- file_name : the file name for the iconset
- icon_index : Icon number
- x : draw spot x-coordinate
- y : draw spot y-coordinate

* All iconsets must be placed in the Pictures folder.

for the VX iconset, and the set used in the Example please use this:



Main Script:

CODE

#=======================================================
# ~** VX iconsets in XP **~
#=======================================================
# Author: LegACy (LegacyX)
# Version: 1.0
# Build Date: 2009-02-26
#-------------------------------------------------------------------------------
#
# This little snippet allows you to use VX iconsets in XP
#
#========================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Icon
# file_name : the file name for the iconset
# icon_index : Icon number
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# enabled : Enabled flag. When false, draw semi-transparently.
#--------------------------------------------------------------------------
def draw_icon(file_name,icon_index, x, y, enabled = true)
bitmap = RPG::Cache.picture(file_name.to_s)
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
end

end


Example Window using this script:

CODE

class Sample_Window < Window_Base
#----------------------------------------------------------------------
# * Object Initialization
#----------------------------------------------------------------------
def initialize
super(20, 20, 100, 100)
self.contents = Bitmap.new(width - 32, height - 32)
refresh # Calls the refresh function in this class
end

def refresh
self.contents.clear
# file name is " IconSet", icon is the 5th in the set.
self.draw_icon("IconSet", 5, 20, 30)
end

end


To test this, make a new event, then add a call event and paste this: Sample_Window.new



Any problems or questions please ask. ~LegACy

This post has been edited by LegACy: Feb 18 2010, 11:21 PM


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
jens009
post Apr 29 2010, 07:54 PM
Post #2


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




I was actually thinking of making this. It's good that I looked first before "reinventing the wheel" eh? haha.

Good job scripting it!


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
Legacy
post May 2 2010, 10:04 AM
Post #3


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




ha thanks jens, no body really commented on this, so i didnt know if it was going to be of any use. lmao.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
DragoonHP
post Jul 21 2010, 09:05 PM
Post #4


Level 1
Group Icon

Group: Member
Posts: 8
Type: Writer
RM Skill: Intermediate




It's a cool script. Now I don't have to rip icons from the iconfile.

Thanks
Go to the top of the page
 
+Quote Post
   
That_Guy
post Jul 24 2010, 10:04 AM
Post #5


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




Arg. I'm getting Syntax Error what did I do wrong?
Go to the top of the page
 
+Quote Post
   
Legacy
post Jul 25 2010, 10:10 AM
Post #6


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




Screenshot of the error would be good. otherwise i don't know what you're doing wrong.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
That_Guy
post Jul 25 2010, 12:06 PM
Post #7


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




Of course, sorry for the vague comment rolleyes.gif

Here's the common event:
Image


Here's the call event:
Image


And here's the wonderful error:
Image


It's probably something stupid I did

Edit: Put spoilers on images

This post has been edited by That_Guy: Jul 25 2010, 12:10 PM
Go to the top of the page
 
+Quote Post
   
Legacy
post Jul 25 2010, 02:23 PM
Post #8


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




Well firstly, you dont need to put scripts in common event boxes. put them in the script editor then call them.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
That_Guy
post Jul 25 2010, 02:41 PM
Post #9


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




I know I just did it because I thought I would be using it a lot. Did you see anything wrong?
Go to the top of the page
 
+Quote Post
   
Legacy
post Jul 25 2010, 02:47 PM
Post #10


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




nothing will be wrong if you put it in the script editor, it's wrong because the call script box cuts off lines and makes the script error.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
That_Guy
post Jul 25 2010, 07:25 PM
Post #11


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




Ah I figured it out. I got confused lol
So, is there a way to use icons from an IconSet for weapon and armor icons in the database?
Go to the top of the page
 
+Quote Post
   
Legacy
post Jul 26 2010, 05:51 AM
Post #12


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




Not at the moment, not unless i recreate the database in C# or Ruby or something. Which i probably could do, but it seems a little too much effort to do right at the moment.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   
That_Guy
post Jul 26 2010, 07:44 PM
Post #13


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Intermediate




Well, thanks for the great script! I'll be sure to credit happy.gif
Go to the top of the page
 
+Quote Post
   
chorrol
post Jul 28 2010, 05:42 AM
Post #14


Level 3
Group Icon

Group: Member
Posts: 39
Type: Event Designer
RM Skill: Advanced




Does this work for items and weapons, etc.?
Go to the top of the page
 
+Quote Post
   
Legacy
post Jul 28 2010, 07:47 AM
Post #15


B★RS Coding Ninja
Group Icon

Group: Global Mod
Posts: 1,414
Type: Scripter
RM Skill: Advanced
Rev Points: 15




It uses iconsets, so you can create your own scenes using iconsets instead of single icons. If you want to use iconsets in the database then i would have to recreate the database to allow this.


__________________________
Freelance Programmer (C#, C++, Ruby)
#onegameamonth


Have you seen the new Unity3D sections?..
Unity 3D Discussion
Unity Script Development
Unity Projects
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 03:16 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker