LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : Previous  1, 2, 3  Next

View previous topic View next topic Go down Message [Page 2 of 3]

Active Member
Active Member
#11 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
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.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
Administrator
Administrator
#12 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
handy333 wrote:This is the only tutorial where it explains everything about everything.
it really just covers the basics in making a window with text.

handy333 wrote:But I still don't fully understand the super()
command.
"super" is the keyword that tells the interpreter to search the parent class and find the initialize method.

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?
Yep, "initialize" is the method you must use to 'automatically call' a new object of a class.

handy333 wrote:Oh and I would really like to understand how width - 32, height - 32 means. Mainly what the - does.
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.
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#13 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
You don't know how much this has helped me.
It was a giant leap in Learning.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
Active Member
Active Member
#14 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
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.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#15 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
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
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#16 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
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.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#17 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
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? Very Happy 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
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#18 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
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.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#19 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
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
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#20 RGSS = Scripting Basics - Window Class - Page 2 Empty Re: RGSS = Scripting Basics - Window Class
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
Sounds serious.

Here's a good/noob question.

How do you assign the player's screen_x to a variable.
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 2 of 3]

Go to page : Previous  1, 2, 3  Next

 

Chatbox system disabled
Personal messaging disabled