Guest Access
Go to page : 1, 2, 3
Active Member
Active Member
Active Member
profile
handy333
profile
This is the only tutorial where it explains everything about everything.
But I still don't fully understand the super()
command.
Do I have to use Initialize for my Def name because I would like to use ini.
Its short and easy to type. Or are Initialize and Main keywords/important?
Oh and I would really like to understand how width - 32, height - 32 means. Mainly what the - does.
But I still don't fully understand the super()
command.
Do I have to use Initialize for my Def name because I would like to use ini.
Its short and easy to type. Or are Initialize and Main keywords/important?
Oh and I would really like to understand how width - 32, height - 32 means. Mainly what the - does.
Active Member
Show Signature
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
it really just covers the basics in making a window with text.handy333 wrote:This is the only tutorial where it explains everything about everything.
"super" is the keyword that tells the interpreter to search the parent class and find the initialize method.handy333 wrote:But I still don't fully understand the super()
command.
Yep, "initialize" is the method you must use to 'automatically call' a new object of a class.handy333 wrote:Do I have to use Initialize for my Def name because I would like to use ini.
Its short and easy to type. Or are Initialize and Main keywords/important?
welp there's a 16 pixel border inside ruby windows that can't be drawn on, so a minus 32 pixels is commonly used to draw to the edge.handy333 wrote:Oh and I would really like to understand how width - 32, height - 32 means. Mainly what the - does.
Administrator
Show Signature
Active Member
Active Member
Active Member
profile
handy333
profile
You don't know how much this has helped me.
It was a giant leap in Learning.
It was a giant leap in Learning.
Active Member
Show Signature
Active Member
Active Member
Active Member
profile
handy333
profile
Ooh, is there a way to change the opacity of the window.
And and what is attr_accessor and the others like reader and write.
And and what is attr_accessor and the others like reader and write.
Active Member
Show Signature
The only one
The only one
The only one
profile
NuKa_BuBble
profile
To change the opacity of a window, use:
self.opacity = (set a value between 0 and 255)
attr_accessor allow to read and change the value of a variable in another class.
attr_reader, read the variable only
attr_writer, change the value only
self.opacity = (set a value between 0 and 255)
attr_accessor allow to read and change the value of a variable in another class.
attr_reader, read the variable only
attr_writer, change the value only
The only one
Show Signature
Active Member
Active Member
Active Member
profile
handy333
profile
Thanks, sorry to be the bother again but I'm really starting to understand this as I go but...I have another question(maybe a few more in the future -_-).
In Input.press?(Input::(X)) what is the question mark(?) for and do I need it here.
I'm trying to make the opacity rise, lower, and reset via button push. I have them in the update def.
Oh and if I wanted to add a window skin to the the script its self how would I do that.
Thanks again.
In Input.press?(Input::(X)) what is the question mark(?) for and do I need it here.
I'm trying to make the opacity rise, lower, and reset via button push. I have them in the update def.
Oh and if I wanted to add a window skin to the the script its self how would I do that.
Thanks again.
Active Member
Show Signature
The only one
The only one
The only one
profile
NuKa_BuBble
profile
It's as a question, you ask: Did the player pressed a button? It is the button (Input::X)? It's a parameter to the method.
And, it's not Input.press?(), it's Input.trigger?().
To change the window skin, press help in the script editor. Search in the index for th class Window.
Don't need an update method for a window class, you can change the name and while the window is called in a class, you refresh this defined method. If you check in the sample, in Scene_Map, I only call the refresh method. I use more the update to update... you know? Like if you have a huge script that must refresh 10 differents methods. The update will gather all the method and refresh them.
(I took it from my karma script)
Like for a HUD:
And, it's not Input.press?(), it's Input.trigger?().
To change the window skin, press help in the script editor. Search in the index for th class Window.
Don't need an update method for a window class, you can change the name and while the window is called in a class, you refresh this defined method. If you check in the sample, in Scene_Map, I only call the refresh method. I use more the update to update... you know? Like if you have a huge script that must refresh 10 differents methods. The update will gather all the method and refresh them.
(I took it from my karma script)
Like for a HUD:
- Code:
#==============================================================================
# ** Karma_Hud
#------------------------------------------------------------------------------
# This class handles the karma HUD.
#==============================================================================
class Karma_Hud < Window_Base
include NuKaBuBbles_Karma
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(HUDX, HUDY, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 24
length = 1
length = 0 if $game_party.karma.abs.to_s.size == 1
length = ($game_party.karma.abs.to_s.size * 15) - (48 / 2) if $game_party.karma.to_s.size > 2
if $game_party.karma >= Good
draw_picture(-4, 2, 0, 0, 1, 1, Good_Pic)
draw_numbers(16+48+length, 0, $game_party.karma, Number_Pic, 3, 0)
elsif $game_party.karma <= Evil
draw_picture(-4, 2, 0, 0, 1, 1, Evil_Pic)
draw_numbers(16+48+length, 0, $game_party.karma, Number_Pic, 3, 2)
else
draw_picture(-4, 2, 0, 0, 1, 1, Neutral_Pic)
draw_numbers(16+48+length, 0, $game_party.karma, Number_Pic, 3, 1)
end
if $game_switches[KPSWITCH] == true
self.visible = true
else
self.visible = false
end
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
include NuKaBuBbles_Karma
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
alias karma_hud_main main
def main
@karma_hud = Karma_Hud.new
karma_hud_main
@karma_hud.dispose
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias karma_hud_update update
def update
karma_hud_update
@karma_hud.refresh
end
end
The only one
Show Signature
Active Member
Active Member
Active Member
profile
handy333
profile
This may be a little off subject but...
Is it possible/easy to make a music
equalizer with rgss?
I want to use certain variables from the bass equalizer in a song to effect the window transparency and color.
Is it possible/easy to make a music
equalizer with rgss?
I want to use certain variables from the bass equalizer in a song to effect the window transparency and color.
Active Member
Show Signature
The only one
The only one
The only one
profile
NuKa_BuBble
profile
Ahhhhh, I never used the music variables in RGSS but, everything is possible. You must know that the limit, it's your knowledge.
The only one
Show Signature
Active Member
Active Member
Active Member
profile
handy333
profile
Sounds serious.
Here's a good/noob question.
How do you assign the player's screen_x to a variable.
Here's a good/noob question.
How do you assign the player's screen_x to a variable.
Active Member
Show Signature
Go to page : 1, 2, 3