ARGSS: Remaking of RGSS Player and Library

This sounds awsome..

Cant wait for it to be finished
Thanks all for the support :)

As trebor777 said, the project is still on, and I am working every day on it. I have mave really lots of changes, in other works I restarted the project again in CodeBlocks using MingW for making porting easier to linux and other systems like mac. However I have never used linux or mac, and never programed something for them. And also, this is my second C/C++ program, the first one was my Input Library dll, and I need to consult C/C++ manuals all the time. But I learn fast, so don't worry about this too much.

Regarding .ini files, I have already managed to have SimpleINI working(Thanks Cowlol, it works pretty good). I will have a look to AMS profile too, thanks Icedmetal.

MysticTrunks wrote:
If this allows full use of ruby with RMXP than all I gotta say is awesome!
I always wondered why some functions in ruby didn't work in XP or even VX, this is nice. Maybe I should hold out on python and learn ruby.
One of the most disgusting things of RPG Maker is that the embedded ruby it has hasn't lots of functions of normal ruby.

Now I am working with SFML(Simple, Fast Multimedia Library) which uses also OpenGL like SDL, but is much better and will spare me lot of work as it has a more similar structure to RPG Maker one.

By now I have almost fully finished Rect and Color, only left to do the marshal methods, and I am now advancing with Bitmap methods. Also I have made a new class(Actually it is a module) called Console, which will create a console window for displaying messages. In most cases that will be better than the pop up box of RM, but I will add also the pop up function. Now I am working with the stretch_blt function which doesn't include SFML so I am reading tutorials of image interpolation.

PD: I will see if I update the first post with the new info.

PD2: The project has a logo, mainly for the .exe icon. Thanks and credits to grafikal009 form rmrk.net! It will be used for next demos and releases.
Image
Nice, good to see you're still on top of this. So this will be capable of running with rpg maker soon? I'd like my games to go a bit faster...^^
so, in dumb talk for people unfamilliar with scripting terms....

are you simply remaking RPG maker itself? (like having the same engine and transmission but a new body?)
Well in a nut shell he is recreating the window that pops up when you press Test Play or run the Game.exe, but his recreated window will be like that window on steroids with a lot more power and possibilities mainly aimed at scripters but just generally improved from the RGSS player.
It's not an exaggeration when I say that this is something I've always wanted since I started my first real project *__* it could revolutionize the RMXP-games... more scripts, more events....

Keep up your good work!
some easy classes should be Color and Font (exept Font.exist?(name))

you can build it in your system
Near wrote:
Nice, good to see you're still on top of this. So this will be capable of running with rpg maker soon? I'd like my games to go a bit faster...^^
I think that I will be able to run rmxp games in a month or less maybe.
kingo'mountain wrote:
are you simply remaking RPG maker itself? (like having the same engine and transmission but a new body?)
Actually yes. I have at this time 2 projects. ARGSS, this one, which aims to be the player of the projects, the one who runs the games in the computer. And RPG Advanced Editor, which will be the tool for editting the game data. If I complete both I will have RPG Maker redone and better.
Alexis Hiemis wrote:
It's not an exaggeration when I say that this is something I've always wanted since I started my first real project *__* it could revolutionize the RMXP-games... more scripts, more events....

Keep up your good work!
Hehe, thanks!
hanmac wrote:
some easy classes should be Color and Font (exept Font.exist?(name))

you can build it in your system
Yeah, some are really easy. At this point I have finished Rect, Color and Tone but excepting marhsal methods which can wait. Font should also be easy. The hardest ones are Graphics, Sprite, Bitmap, Tilemap, Viewport and Window, in other words all things related to graphics. Input and Audio should be easy, as well as Table.
Nice! I was hoping for an answer like that. Well keep it up man :thumb:
At last I can bring you some news!
I have almost finished Sprite class, half of Bitmap(Some methods I still need to work with), and Graphics is in good progress. Now I can display sprites again in screen with SFML library(Remember that I have left SDL away and started again from zero with SFML). Also, I have been working on Z sorting for objects and it seems to work well.
Now I will go with the Bitmap and Sprite class until finishing them as well as the Input module, but this last one should be easy to make, as I have been working with Input for long time. I will look to release a new demo when finishing Bitmap, Sprite and Input.

Mmm... I have to update the first topic, it is totaly outdated, but I am kinda lazy with that, hehe. I will see if I make some time for it.

Edit: Updated first topic :)
Hi ! I just found this topic !

I'm really happy to see that you are working on a new game.exe.
I was expecting a lot of things from Youpi / Trebor777 project, and I was really sad when I saw

I was planning to replace game.exe with a complete Ruby graphical engine made with Irrlicht (because of Demonfire's work) or Gosu.
I nearly succeed to do it with RUDL and Rubygame, but these projects are no more updated.

Whatever, your solution is far much better ! :D


Contact me if you can't contact Trebor, I will spam him for you. ;)
France is with you !

______________________


I will not be able to help directly, but I can give you the Roys mail.
He is working on XNA, in order to run RM games with it. Even if he can't give you code, he worked a lot about replace game.exe, so I suppose you could have some help.


______________________

What about the licence ? It's a freeware, but will you choose something like MIT ?
We could use your work, for both commercial and non-commercial purpose, and all we need to do is to credit you ?
Something like that ?
Rubygame is still updated, 2.5 came out like a month or 2 ago, it's just the windows version is still at 2.3... because nobody cares about making the compiled version for windows...

vgvgf and me are on msn ^^ since a while ( how long actually xD? ) 😀
I want to do something like this with DXLib, a Japanese game library, as well. DXLib use C and DirectX as its back end and the library feature many many game focusing features such as 4 joypads support as well as analog controllers, as well as being able to play video files :D

Could you please direct me to where I should go to learn more about embedding Ruby in C/C++ application? Right now I'm using Lua since it is very easy to embed, but I still can't get over ruby and want to use it XD
trebor777 wrote:
Rubygame is still updated, 2.5 came out like a month or 2 ago, it's just the windows version is still at 2.3... because nobody cares about making the compiled version for windows...

Oh, yeah ! I was afraid because the last time I saw news, it was because the leader of the project stoped to work on it, and there was nobody to care about the job. Thanks for the news.

trebor777 wrote:
vgvgf and me are on msn ^^ since a while ( how long actually xD? ) 😀

I didn't see you a lot recently... or maybe I was the one who wasn't connected ? XD
You're lucky I didn't need to annoy.. well, that I didn't need your super knowledges. :)

I hope you will help Vgvgf a lot, so we will have a running game.exe within a few months (before 2010 will be cool). ;)

__________


I don't know if it will usefull, but I asked one month ago about compiling Ruby 1.9.1 into one exe :
http://www.ruby-forum.com/topic/187340
It's possible thanks to OCRA.

But I know it's not the solution you are looking for. ;)
NEW DEMO!

Big news! I am back working on it, now in vacations!!!!

I haven't been working since some time ago, cause I had to study for university, I was working a bit on RPGAE(Yeah, it is still alive now in VB.net), and also I was/am working on my new web(In spanish though).

But I have been working this week a lot and here I bring you a new demostration of ARGSS. Check the first post for downloading and for seeing the progress list.

Remember to look the ARGSS.ini, you can change the resolution from it. Also, there are new methods, checl the progress list.

Remember to report any error, bug, or problem you find.


King Kadelfek wrote:
What about the licence ? It's a freeware, but will you choose something like MIT ?
We could use your work, for both commercial and non-commercial purpose, and all we need to do is to credit you ?
Something like that ?
I still don't know. But I still have much time for thinking on it, hehe.

King Kadelfek wrote:
Contact me if you can't contact Trebor, I will spam him for you. ;)
France is with you !
Haha, Trebor is helping me on msn since a while ago.

hima wrote:
I want to do something like this with DXLib, a Japanese game library, as well. DXLib use C and DirectX as its back end and the library feature many many game focusing features such as 4 joypads support as well as analog controllers, as well as being able to play video files :D

Could you please direct me to where I should go to learn more about embedding Ruby in C/C++ application? Right now I'm using Lua since it is very easy to embed, but I still can't get over ruby and want to use it XD
For embedding Ruby, first of course, download a nice version of it, the one you like(However, I wasn't able to embed 1.9.1 yet). If you are working with MS Visual Studio, I recommend you to download the Ruby Installer 1.8.6, which includes already compiled libraries of it. Then you have to link the ruby libraries, the dinamic one or the static one, and also add the include path for: "ruby\lib\ruby\1.8\i386-mswin32" for example if you have used the windows installer, or "C:\usr\ruby-1.8.6-p386\lib\ruby\1.8\i386-mingw32" if you have compiled it with mingw.
Then, you just need to start ruby:
  1.    ruby_init();
  2.     rb_load_file("Scripts.rb");
  3.     ruby_run();
Expand to see the code.

And you have ruby running. There are some tutorials around internet also. And, you should also check the "Extending Ruby" from the Programming Ruby guide.
Good luck!

King Kadelfek wrote:
I don't know if it will usefull, but I asked one month ago about compiling Ruby 1.9.1 into one exe :
http://www.ruby-forum.com/topic/187340
It's possible thanks to OCRA.

But I know it's not the solution you are looking for. ;)
Thanks, I will check that :)
Firstly, hats off to you vgvgf! :thumb:

I might have missed it in the first post but I didn't see a Graphics.snap or similar in the list. Could you include the ability to take screenshots in-game? I'm not at all experienced in development at this level but as a casual scripter, I've always wanted that option.
First of all fantastic project and if you can pull this off then it will be amazing.

But the only thing that interests me is: will require work? I assume that is what you mean by "full ruby" :) it's the main thing that gripes me about RGSS and halts most of my projects :(

Oh wait you have a demo that is cool

Wow, RMXP generally runs at 27 fps for me; your demo runs at 27 fps when I have 500 sprites. (61 with 100) That's pretty cool. The resolution is definately a plus (in fact, I believe Amanda Fae was paying a hefty sum for a resolution script, you might want to contact her).
Fantasist wrote:
Firstly, hats off to you vgvgf! :thumb:

I might have missed it in the first post but I didn't see a Graphics.snap or similar in the list. Could you include the ability to take screenshots in-game? I'm not at all experienced in development at this level but as a casual scripter, I've always wanted that option.
Thanks Fantasist :)
I will add that option, like the RMVX one. In the progress list I have only added RMXP RGSS methods, I have to update it also with RMVX ones like the snapshot and some others.

Commodore Whynot wrote:
First of all fantastic project and if you can pull this off then it will be amazing.

But the only thing that interests me is: will require work? I assume that is what you mean by "full ruby" :) it's the main thing that gripes me about RGSS and halts most of my projects :(

Oh wait you have a demo that is cool

Wow, RMXP generally runs at 27 fps for me; your demo runs at 27 fps when I have 500 sprites. (61 with 100) That's pretty cool. The resolution is definately a plus (in fact, I believe Amanda Fae was paying a hefty sum for a resolution script, you might want to ontact her).
Thanks Wyatt.
Actualy, require works in the demo. Add this to the demo, it will change the Scripts.rb file and add the file Win32API.so. It's just some testing script for requiring a .so file and testing some Win32API.
I will see later to include Win32API in the .exe or the .dll.

Also, I have seen that paid request, but this will be free and I don't wan't people pay for it. Maybe I will accept donations later for a new computer and as an incentive.
Would this project be released under an open source license?
I remember you saying that you like to work alone, in that case would you be interested in only open sourcing the code while still working on it yourself without other contributors? I understand if you just like keeping your code to yourself, but it's just a very exciting project and I'm sure many people would be interested in learning more about it.
Cowlol wrote:
Would this project be released under an open source license?
I remember you saying that you like to work alone, in that case would you be interested in only open sourcing the code while still working on it yourself without other contributors? I understand if you just like keeping your code to yourself, but it's just a very exciting project and I'm sure many people would be interested in learning more about it.
I still don't which license to use. And I won't release to the public the sources of the project without a license. However, I have a quick solution for really interesed people on the project. I have uploaded the project to DropBox, so make an account there if you haven't one already(Use my referral code) and send me a PM with the email you used for registration and I will share the ARGSS codes with you Cowlol, and also other interested and trustable people(If I don't know you, don't expect I will share the codes with you...).
I have the Window class, re-written by Sewlyn if you'd like it. It could use some cleanup work, but at the very least it works just like the origional and you can even define the width of the border margins too, which is nice (I never did like the 16 pixel border, I always wanted to reduce it, apparently you can with this...)

Window Spoiler
  1. #==============================================================================
  2. # ¦ Window - Hidden RGSS Class
  3. #------------------------------------------------------------------------------
  4. #  by Selwyn
  5. #==============================================================================
  6.  
  7. #==============================================================================
  8. # ¦ Bitmap
  9. #==============================================================================
  10.  
  11. class Bitmap
  12.  #--------------------------------------------------------------------------
  13.  # ? erase
  14.  #--------------------------------------------------------------------------
  15.  def erase(*args)
  16.    if args.size == 1
  17.      rect = args[0]
  18.    elsif args.size == 4
  19.      rect = Rect.new(*args)
  20.    end
  21.    fill_rect(rect, Color.new(0, 0, 0, 0))
  22.  end
  23. end
  24.  
  25. #==============================================================================
  26. # ? SG
  27. #------------------------------------------------------------------------------
  28. #  Selwyn's Graphics module
  29. #==============================================================================
  30.  
  31. module SG
  32. #==============================================================================
  33. # ¦ SG::Skin
  34. #==============================================================================
  35.  
  36. class Skin
  37.  #--------------------------------------------------------------------------
  38.  # ? instances settings
  39.  #--------------------------------------------------------------------------
  40.  attr_reader   :margin
  41.  attr_accessor :bitmap
  42.  #--------------------------------------------------------------------------
  43.  # ? initialize
  44.  #--------------------------------------------------------------------------
  45.  def initialize
  46.    @bitmap = nil
  47.    @values = {}
  48.    @values['bg'] = Rect.new(0, 0, 128, 128)
  49.    @values['pause0'] = Rect.new(160, 64, 16, 16)
  50.    @values['pause1'] = Rect.new(176, 64, 16, 16)
  51.    @values['pause2'] = Rect.new(160, 80, 16, 16)
  52.    @values['pause3'] = Rect.new(176, 80, 16, 16)
  53.    @values['arrow_up'] = Rect.new(152, 16, 16, 8)
  54.    @values['arrow_down'] = Rect.new(152, 40, 16, 8)
  55.    @values['arrow_left'] = Rect.new(144, 24, 8, 16)
  56.    @values['arrow_right'] = Rect.new(168, 24, 8, 16)
  57.    self.margin = 16
  58.  end
  59.  #--------------------------------------------------------------------------
  60.  # ? width
  61.  #--------------------------------------------------------------------------
  62.  def margin=(width)
  63.    @margin = width
  64.    set_values
  65.  end
  66.  #--------------------------------------------------------------------------
  67.  # ? set_values
  68.  #--------------------------------------------------------------------------
  69.  def set_values
  70.    w = @margin
  71.    @values['ul_corner'] = Rect.new(128, 0, w, w)
  72.    @values['ur_corner'] = Rect.new(192-w, 0, w, w)
  73.    @values['dl_corner'] = Rect.new(128, 64-w, w, w)
  74.    @values['dr_corner'] = Rect.new(192-w, 64-w, w, w)
  75.    @values['up'] = Rect.new(128+w, 0, 64-2*w, w)
  76.    @values['down'] = Rect.new(128+w, 64-w, 64-2*w, w)
  77.    @values['left'] = Rect.new(128, w, w, 64-2*w)
  78.    @values['right'] = Rect.new(192-w, w, w, 64-2*w)
  79.  end
  80.  #--------------------------------------------------------------------------
  81.  # ? []
  82.  #--------------------------------------------------------------------------
  83.  def [](value)
  84.    return @values[value]
  85.  end
  86. end
  87.  
  88.  
  89. #==============================================================================
  90. # ¦ SG::Cursor_Rect
  91. #==============================================================================
  92.  
  93. class Cursor_Rect < ::Sprite
  94.  #--------------------------------------------------------------------------
  95.  # ? instances settings
  96.  #--------------------------------------------------------------------------
  97.  attr_reader   :height, :width, :skin, :margin
  98.  #--------------------------------------------------------------------------
  99.  # ? initialize
  100.  #--------------------------------------------------------------------------
  101.  def initialize(viewport)
  102.    super(viewport)
  103.    @width = 0
  104.    @height = 0
  105.    @skin = nil
  106.    @margin = 0
  107.    @rect = {}
  108.    @rect['cursor_up'] = Rect.new(129, 64, 30, 1)
  109.    @rect['cursor_down'] = Rect.new(129, 95, 30, 1)
  110.    @rect['cursor_left'] = Rect.new(128, 65, 1, 30)
  111.    @rect['cursor_right'] = Rect.new(159, 65, 1, 30)
  112.    @rect['upleft'] = Rect.new(128, 64, 1, 1)
  113.    @rect['upright'] = Rect.new(159, 64, 1, 1)
  114.    @rect['downleft'] = Rect.new(128, 95, 1, 1)
  115.    @rect['downright'] = Rect.new(159, 95, 1, 1)
  116.    @rect['bg'] = Rect.new(129, 65, 30, 30)
  117.  end
  118.  #--------------------------------------------------------------------------
  119.  # ? margin=
  120.  #--------------------------------------------------------------------------
  121.  def margin=(margin)
  122.    @margin = margin
  123.    set(x, y, width, height)
  124.  end
  125.  #--------------------------------------------------------------------------
  126.  # ? skin=
  127.  #--------------------------------------------------------------------------
  128.  def skin=(skin)
  129.    @skin = skin
  130.    draw_rect
  131.  end
  132.  #--------------------------------------------------------------------------
  133.  # ? width=
  134.  #--------------------------------------------------------------------------
  135.  def width=(width)
  136.    return if @width == width
  137.    @width = width
  138.    if @width == 0 and self.bitmap != nil
  139.      self.bitmap.dispose
  140.      self.bitmap = nil
  141.    end
  142.    draw_rect
  143.  end
  144.  #--------------------------------------------------------------------------
  145.  # ? height=
  146.  #--------------------------------------------------------------------------
  147.  def height=(height)
  148.    return if @height == height
  149.    @height = height
  150.    if @height == 0 and self.bitmap != nil
  151.      self.bitmap.dispose
  152.      self.bitmap = nil
  153.    end
  154.    draw_rect
  155.  end
  156.  #--------------------------------------------------------------------------
  157.  # ? set
  158.  #--------------------------------------------------------------------------
  159.  def set(x, y, width, height)
  160.    self.x = x + @margin
  161.    self.y = y + @margin
  162.    if @width != width or @height != height
  163.      @width = width
  164.      @height = height
  165.      if width > 0 and height > 0
  166.        draw_rect
  167.      end
  168.    end
  169.  end
  170.  #--------------------------------------------------------------------------
  171.  # ? empty
  172.  #--------------------------------------------------------------------------
  173.  def empty
  174.    self.x = 0
  175.    self.y = 0
  176.    self.width = 0
  177.    self.height = 0
  178.  end
  179.  #--------------------------------------------------------------------------
  180.  # ? draw_rect
  181.  #--------------------------------------------------------------------------
  182.  def draw_rect
  183.    return if @skin == nil
  184.    if @width > 0 and @height > 0
  185.      self.bitmap = Bitmap.new(@width, @height)
  186.      rect = Rect.new(1, 1, @width - 2, @height - 2)
  187.      self.bitmap.stretch_blt(rect, @skin, @rect['bg'])
  188.      self.bitmap.blt(0, 0, @skin, @rect['upleft'])
  189.      self.bitmap.blt(@width-1, 0, @skin, @rect['upright'])
  190.      self.bitmap.blt(0, @height-1, @skin, @rect['downright'])
  191.      self.bitmap.blt(@width-1, @height-1, @skin, @rect['downleft'])
  192.      rect = Rect.new(1, 0, @width - 2, 1)
  193.      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_up'])
  194.      rect = Rect.new(0, 1, 1, @height - 2)
  195.      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_left'])
  196.      rect = Rect.new(1, @height-1, @width - 2, 1)
  197.      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_down'])
  198.      rect = Rect.new(@width - 1, 1, 1, @height - 2)
  199.      self.bitmap.stretch_blt(rect, @skin, @rect['cursor_right'])
  200.    end
  201.  end
  202. end
  203.  
  204. #==============================================================================
  205. # ¦ SG::Window
  206. #------------------------------------------------------------------------------
  207. #  
  208. #==============================================================================
  209.  
  210. class Window
  211.  #--------------------------------------------------------------------------
  212.  # ? set instances variables
  213.  #--------------------------------------------------------------------------
  214.  attr_reader(:x, :y, :z, :width, :height, :ox, :oy, :opacity, :back_opacity,
  215.              :stretch, :contents_opacity, :visible, :pause)
  216.  attr_accessor :active
  217.  #--------------------------------------------------------------------------
  218.  # ? initialize
  219.  #--------------------------------------------------------------------------
  220.  def initialize()
  221.    @skin = Skin.new
  222.    @viewport = Viewport.new(0, 0, 0, 0)
  223.    @cr_vport = Viewport.new(0, 0, 0, 0)
  224.    @width = 0
  225.    @height = 0
  226.    @ox = 0
  227.    @oy = 0
  228.    @opacity = 255
  229.    @back_opacity = 255
  230.    @contents_opacity = 255
  231.    @frame   = Sprite.new()
  232.    @bg      = Sprite.new()
  233.    @window  = Sprite.new(@viewport)
  234.    @pause_s = Sprite.new()
  235.    @arrows = []
  236.    for i in 0...4
  237.      @arrows.push(Sprite.new(@cr_vport))
  238.      @arrows[i].bitmap = Bitmap.new(16, 16)
  239.      @arrows[i].visible = false
  240.    end
  241.    @cursor_rect = Cursor_Rect.new(@cr_vport)
  242.    @cursor_rect.margin = @skin.margin
  243.    @cursor_fade = true
  244.    @pause_s.visible = false
  245.    @pause = false
  246.    @active = true
  247.    @stretch = true
  248.    @visible = true
  249.    self.x = 0
  250.    self.y = 0
  251.    self.z = 100
  252.    self.windowskin = RPG::Cache.windowskin($game_system.windowskin_name)
  253.  end
  254.  #--------------------------------------------------------------------------
  255.  # ? contents=
  256.  #--------------------------------------------------------------------------
  257.  def contents=(bmp)
  258.    @window.bitmap = bmp
  259.    if bmp != nil
  260.      if bmp.width > @viewport.rect.width
  261.         bmp.height > @viewport.rect.height
  262.        draw_arrows
  263.      end
  264.    end
  265.  end
  266.  #--------------------------------------------------------------------------
  267.  # ? contents
  268.  #--------------------------------------------------------------------------
  269.  def contents
  270.    return @window.bitmap
  271.  end
  272.  #--------------------------------------------------------------------------
  273.  # ? dispose
  274.  #--------------------------------------------------------------------------
  275.  def dispose
  276.    @bg.dispose
  277.    @frame.dispose
  278.    @window.dispose
  279.    @cursor_rect.dispose
  280.    @viewport.dispose
  281.    @pause_s.dispose
  282.    @cr_vport.dispose
  283.    for arrow in @arrows
  284.      arrow.dispose
  285.    end
  286.  end
  287.  #--------------------------------------------------------------------------
  288.  # ? update
  289.  #--------------------------------------------------------------------------
  290.  def update
  291.    @window.update
  292.    @cursor_rect.update
  293.    @viewport.update
  294.    @cr_vport.update
  295.    @pause_s.src_rect = @skin["pause#{(Graphics.frame_count / 8) % 4}"]
  296.    @pause_s.update
  297.    update_visible
  298.    update_arrows
  299.    if @cursor_fade
  300.      @cursor_rect.opacity -= 10
  301.      @cursor_fade = false if @cursor_rect.opacity <= 100
  302.    else
  303.      @cursor_rect.opacity += 10
  304.      @cursor_fade = true if @cursor_rect.opacity >= 255
  305.    end
  306.  end
  307.  #--------------------------------------------------------------------------
  308.  # ? update_visible
  309.  #--------------------------------------------------------------------------
  310.  def update_visible
  311.    @frame.visible = @visible
  312.    @bg.visible = @visible
  313.    @window.visible = @visible
  314.    @cursor_rect.visible = @visible
  315.    if @pause
  316.      @pause_s.visible = @visible
  317.    else
  318.      @pause_s.visible = false
  319.    end
  320.  end
  321.  #--------------------------------------------------------------------------
  322.  # ? pause=
  323.  #--------------------------------------------------------------------------
  324.  def pause=(pause)
  325.    @pause = pause
  326.    update_visible
  327.  end
  328.  #--------------------------------------------------------------------------
  329.  # ? update_arrows
  330.  #--------------------------------------------------------------------------
  331.  def update_arrows
  332.    if @window.bitmap == nil or @visible == false
  333.      for arrow in @arrows
  334.        arrow.visible = false
  335.      end
  336.    else
  337.      @arrows[0].visible = @oy > 0
  338.      @arrows[1].visible = @ox > 0
  339.      @arrows[2].visible = (@window.bitmap.width - @ox) > @viewport.rect.width
  340.      @arrows[3].visible = (@window.bitmap.height - @oy) > @viewport.rect.height
  341.    end
  342.  end
  343.  #--------------------------------------------------------------------------
  344.  # ? visible=
  345.  #--------------------------------------------------------------------------
  346.  def visible=(visible)
  347.    @visible = visible
  348.    update_visible
  349.    update_arrows
  350.  end
  351.  #--------------------------------------------------------------------------
  352.  # ? x=
  353.  #--------------------------------------------------------------------------
  354.  def x=(x)
  355.    @x = x
  356.    @bg.x = x + 2
  357.    @frame.x = x
  358.    @viewport.rect.x = x + @skin.margin
  359.    @cr_vport.rect.x = x
  360.    @pause_s.x = x + (@width / 2) - 8
  361.    set_arrows
  362.  end
  363.  #--------------------------------------------------------------------------
  364.  # ? y=
  365.  #--------------------------------------------------------------------------
  366.  def y=(y)
  367.    @y = y
  368.    @bg.y = y + 2
  369.    @frame.y = y
  370.    @viewport.rect.y = y + @skin.margin
  371.    @cr_vport.rect.y = y
  372.    @pause_s.y = y + @height - @skin.margin
  373.    set_arrows
  374.  end
  375.  #--------------------------------------------------------------------------
  376.  # ? z=
  377.  #--------------------------------------------------------------------------
  378.  def z=(z)
  379.    @z = z
  380.    @bg.z = z
  381.    @frame.z = z + 1
  382.    @cr_vport.z = z + 2
  383.    @viewport.z = z + 3
  384.    @pause_s.z = z + 4
  385.  end
  386.  #--------------------------------------------------------------------------
  387.  # ? ox=
  388.  #--------------------------------------------------------------------------
  389.  def ox=(ox)
  390.    return if @ox == ox
  391.    @ox = ox
  392.    @viewport.ox = ox
  393.    update_arrows
  394.  end
  395.  #--------------------------------------------------------------------------
  396.  # ? oy=
  397.  #--------------------------------------------------------------------------
  398.  def oy=(oy)
  399.    return if @oy == oy
  400.    @oy = oy
  401.    @viewport.oy = oy
  402.    update_arrows
  403.  end
  404.  #--------------------------------------------------------------------------
  405.  # ? width=
  406.  #--------------------------------------------------------------------------
  407.  def width=(width)
  408.    @width = width
  409.    @viewport.rect.width = width - @skin.margin * 2
  410.    @cr_vport.rect.width = width
  411.    if @width > 0 and @height > 0
  412.      @frame.bitmap = Bitmap.new(@width, @height)
  413.      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
  414.      draw_window
  415.    end
  416.    self.x = @x
  417.    self.y = @y
  418.  end
  419.  #--------------------------------------------------------------------------
  420.  # ? height=
  421.  #--------------------------------------------------------------------------
  422.  def height=(height)
  423.    @height = height
  424.    @viewport.rect.height = height - @skin.margin * 2
  425.    @cr_vport.rect.height = height
  426.    if @height > 0 and @width > 0
  427.      @frame.bitmap = Bitmap.new(@width, @height)
  428.      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
  429.      draw_window
  430.    end
  431.    self.x = @x
  432.    self.y = @y
  433.  end
  434.  #--------------------------------------------------------------------------
  435.  # ? opacity=
  436.  #--------------------------------------------------------------------------
  437.  def opacity=(opacity)
  438.    value = [[opacity, 255].min, 0].max
  439.    @opacity = value
  440.    @contents_opacity = value
  441.    @back_opacity = value
  442.    @frame.opacity = value
  443.    @bg.opacity = value
  444.    @window.opacity = value
  445.  end
  446.  #--------------------------------------------------------------------------
  447.  # ? back_opacity=
  448.  #--------------------------------------------------------------------------
  449.  def back_opacity=(opacity)
  450.    value = [[opacity, 255].min, 0].max
  451.    @back_opacity = value
  452.    @bg.opacity = value
  453.  end
  454.  #--------------------------------------------------------------------------
  455.  # ? contents_opacity=
  456.  #--------------------------------------------------------------------------
  457.  def contents_opacity=(opacity)
  458.    value = [[opacity, 255].min, 0].max
  459.    @contents_opacity = value
  460.    @window.opacity = value
  461.  end
  462.  #--------------------------------------------------------------------------
  463.  # ? cursor_rect
  464.  #--------------------------------------------------------------------------
  465.  def cursor_rect
  466.    return @cursor_rect
  467.  end
  468.  #--------------------------------------------------------------------------
  469.  # ? cursor_rect=
  470.  #--------------------------------------------------------------------------
  471.  def cursor_rect=(rect)
  472.    @cursor_rect.x = rect.x
  473.    @cursor_rect.y = rect.y
  474.    if @cursor_rect.width != rect.width or @cursor_rect.height != rect.height
  475.      @cursor_rect.set(@cursor_rect.x, @cursor_rect.y, rect.width, rect.height)
  476.    end
  477.  end
  478.  #--------------------------------------------------------------------------
  479.  # ? windowskin
  480.  #--------------------------------------------------------------------------
  481.  def windowskin
  482.    return @skin.bitmap
  483.  end
  484.  #--------------------------------------------------------------------------
  485.  # ? windowskin=
  486.  #--------------------------------------------------------------------------
  487.  def windowskin=(windowskin)
  488.    return if windowskin == nil
  489.    if @skin.bitmap != windowskin
  490.      @pause_s.bitmap = windowskin
  491.      @pause_s.src_rect = @skin['pause0']
  492.      @skin.bitmap = windowskin
  493.      @cursor_rect.skin = windowskin
  494.      draw_window
  495.      draw_arrows
  496.    end
  497.  end
  498.  #--------------------------------------------------------------------------
  499.  # ? margin=
  500.  #--------------------------------------------------------------------------
  501.  def margin=(margin)
  502.    if @skin.margin != margin
  503.      @skin.margin = margin
  504.      self.x = @x
  505.      self.y = @y
  506.      temp = @height
  507.      self.height = 0
  508.      self.width = @width
  509.      self.height = temp
  510.      @cursor_rect.margin = margin
  511.      set_arrows
  512.    end
  513.  end
  514.  #--------------------------------------------------------------------------
  515.  # ? stretch=
  516.  #--------------------------------------------------------------------------
  517.  def stretch=(bool)
  518.    if @stretch != bool
  519.      @stretch = bool
  520.      draw_window
  521.    end
  522.  end
  523.  #--------------------------------------------------------------------------
  524.  # ? set_arrows
  525.  #--------------------------------------------------------------------------
  526.  def set_arrows
  527.    @arrows[0].x = @width / 2 - 8
  528.    @arrows[0].y = 8
  529.    @arrows[1].x = 8
  530.    @arrows[1].y = @height / 2 - 8
  531.    @arrows[2].x = @width - 16
  532.    @arrows[2].y = @height / 2 - 8
  533.    @arrows[3].x = @width / 2 - 8
  534.    @arrows[3].y = @height - 16
  535.  end
  536.  #--------------------------------------------------------------------------
  537.  # ? draw_arrows
  538.  #--------------------------------------------------------------------------
  539.  def draw_arrows
  540.    return if @skin.bitmap == nil
  541.    @arrows[0].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_up'])
  542.    @arrows[1].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_left'])
  543.    @arrows[2].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_right'])
  544.    @arrows[3].bitmap.blt(0, 0, @skin.bitmap, @skin['arrow_down'])
  545.    update_arrows
  546.  end
  547.  #--------------------------------------------------------------------------
  548.  # ? draw_window
  549.  #--------------------------------------------------------------------------
  550.  def draw_window
  551.    return if @skin.bitmap == nil
  552.    return if @width == 0 or @height == 0
  553.    m = @skin.margin
  554.    if @frame.bitmap.nil?
  555.      @frame.bitmap = Bitmap.new(@width, @height)
  556.      @bg.bitmap = Bitmap.new(@width - 4, @height - 4)
  557.    end
  558.    @frame.bitmap.clear
  559.    @bg.bitmap.clear
  560.    if @stretch
  561.      dest_rect = Rect.new(0, 0, @width-4, @height-4)
  562.      @bg.bitmap.stretch_blt(dest_rect, @skin.bitmap, @skin['bg'])
  563.    else
  564.      bgw = Integer((@width-4) / 128) + 1
  565.      bgh = Integer((@height-4) / 128) + 1
  566.      for x in 0..bgw
  567.        for y in 0..bgh
  568.          @bg.bitmap.blt(x * 128, y * 128, @skin.bitmap, @skin['bg'])
  569.        end
  570.      end
  571.    end
  572.    bx = Integer((@width - m*2) / @skin['up'].width) + 1
  573.    by = Integer((@height - m*2) / @skin['left'].height) + 1
  574.    for x in 0..bx
  575.      w = @skin['up'].width
  576.      @frame.bitmap.blt(x * w + m, 0, @skin.bitmap, @skin['up'])
  577.      @frame.bitmap.blt(x * w + m, @height - m, @skin.bitmap, @skin['down'])
  578.    end
  579.    for y in 0..by
  580.      h = @skin['left'].height
  581.      @frame.bitmap.blt(0, y * h + m, @skin.bitmap, @skin['left'])
  582.      @frame.bitmap.blt(@width - m, y * h + m, @skin.bitmap, @skin['right'])
  583.    end
  584.    @frame.bitmap.erase(@width - m, 0, m, m)
  585.    @frame.bitmap.erase(0, @height - m, m, m)
  586.    @frame.bitmap.erase(@width - m, @height - m, m, m)
  587.    @frame.bitmap.blt(0, 0, @skin.bitmap, @skin['ul_corner'])
  588.    @frame.bitmap.blt(@width - m, 0, @skin.bitmap, @skin['ur_corner'])
  589.    @frame.bitmap.blt(0, @height - m, @skin.bitmap, @skin['dl_corner'])
  590.    @frame.bitmap.blt(@width - m, @height - m, @skin.bitmap, @skin['dr_corner'])
  591.  end
  592. end
  593.  
  594. end
  595.  
Expand to see the code.


If I come across anything else, as far as re-written RGSS classes, I'll try and save it and post it for you just so you can have some reference.

Good luck on this project :thumb:
Thanks Kain Nobel, though I have it already, hehe. I have too the Plane class rewrite by Selwyn, I think it was made by him too, and also lots of Tileset rewrites.

Also, somebody knows how to use freetype library for drawing a text to a bitmap, or another good alternative for drawing text?
Maybe this link of DerVVulfman with SFonts can help you:
http://houseslasher.com/index.php?showtopic=323

There's an error in the demo (ia_a? => is_a?)

Any Help you need you can ask me, C/C++/Ruby/RGSS
I will always try to help you!

Continue this great job and please make it open source, maybe not now but in a near future, so the code will always exist.

OH, I was reading the first page and Console class is there!
here(RMXP) i use some Win32API to have the console opened, puts and gets methods working.
I only use those for debugging.

  1.  
  2. AC = Win32API.new('kernel32', 'AllocConsole', '', 'l')
  3. SFW = Win32API.new('user32', 'SetForegroundWindow', 'l', 'l')
  4. HWND = Win32API.new('user32', 'GetActiveWindow', '', 'l').call
  5.  
  6. def debug
  7.   AC.call
  8.   SFW.call(HWND)
  9.   $stdout.reopen('CONOUT$')
  10.   $stdin.reopen('CONIN$')
  11. end
  12.  
  13. debug
  14. puts 'Hello World in Console'
  15. gets gets
  16.  
Expand to see the code.


Sorry for any english errors and Good Luck, MauMau
I haven't seen that typo in the demo, as I haven't had errors when testing it. Also, I will see to implement SFont, but I have managed to have freetype working now :)

Thanks MauMau
I have only two words to say : GREAT work !
I looked for a way to work on a RGSS like library without RM for a long time, and you've just brought me the way to do that !

Just a question : could we get the C/C++ sources ? I'd like to get them for two reasons :
- Learn how to display a Sprite and create Bitmap in C/C++.
- Try to change or add something to the library, like drawing fonctions (draw_circle, etc...), which are faster in C/C++ than in Ruby.

You're doing a very great work, congratulations, and thank you !
As King Kadelfek said, France is with you !

(Sorry for English errors)


RPG-man


Edit : Tested ! It works well ! However, I have some thing to tell you about it :
- Win32API is not included, and no Input fonctions are already in ARGSS, so, I can't create myself Win32API Input fonctions...
- Zlib isn't integrated too. Could you please include Zlib to the exe ? It's very usefull for data encoding, and script encoding ! I made a system which create a script containing all the others scripts, and the scripts inside are usually compressed with Zlib, but beccause Zlib is not included, I can't compress my scripts. :sad:
- How to change Ruby version in the exe ? I've heard something interesting about Ruby on its site : since version 2.0, Ruby would be pre-compiled in byte code... It's very interesting beccause Ruby code execution will be faster !


However, ARGSS is perfectly usable, and it's very agreable to program with this library on an IDE like NetBeans !
@RPG-man
vgvgf wrote:
I still don't which license to use. And I won't release to the public the sources of the project without a license. However, I have a quick solution for really interesed people on the project. I have uploaded the project to DropBox, so make an account there if you haven't one already(Use my referral code) and send me a PM with the email you used for registration and I will share the ARGSS codes with you Cowlol, and also other interested and trustable people(If I don't know you, don't expect I will share the codes with you...).


Adding Zlib is actually a very good idea. I'd love to see how that's done too.


Also, Vgvgf I've finally managed to embedded ruby into my engine now. Thank you so much!
RPG-man wrote:
I have only two words to say : GREAT work !
I looked for a way to work on a RGSS like library without RM for a long time, and you've just brought me the way to do that !

Just a question : could we get the C/C++ sources ? I'd like to get them for two reasons :
- Learn how to display a Sprite and create Bitmap in C/C++.
- Try to change or add something to the library, like drawing fonctions (draw_circle, etc...), which are faster in C/C++ than in Ruby.

You're doing a very great work, congratulations, and thank you !
As King Kadelfek said, France is with you !

(Sorry for English errors)


RPG-man


Edit : Tested ! It works well ! However, I have some thing to tell you about it :
- Win32API is not included, and no Input fonctions are already in ARGSS, so, I can't create myself Win32API Input fonctions...
- Zlib isn't integrated too. Could you please include Zlib to the exe ? It's very usefull for data encoding, and script encoding ! I made a system which create a script containing all the others scripts, and the scripts inside are usually compressed with Zlib, but beccause Zlib is not included, I can't compress my scripts. :sad:
- How to change Ruby version in the exe ? I've heard something interesting about Ruby on its site : since version 2.0, Ruby would be pre-compiled in byte code... It's very interesting beccause Ruby code execution will be faster !


However, ARGSS is perfectly usable, and it's very agreable to program with this library on an IDE like NetBeans !
Thanks RPG man :)

I will release the sources of ARGSS, but not right now. However, look this post I made http://www.hbgames.org/forums/viewtopic.php?p=649622#p649622

Win32API can be included with require, but I will add it internaly to the library. See this: http://www.hbgames.org/forums/viewtopic.php?p=649275#p649275

I will include ZLib, remember that this will work the same as RMXP/RMVX plus some extra things. Actualy, it is already included for loading .png graphics, but it isn't available for ruby, hehe. I will add it.

Regarding the Ruby version, I am using right now 1.8.6, and I will update to 1.9.1 when I can make it work, I still can't do so, but I haven't worked on that really much...
If version 2.00 comes out, I will also see to upgrade to it.

hima wrote:
Also, Vgvgf I've finally managed to embedded ruby into my engine now. Thank you so much!
That sounds good! If you need help, just ask.
Quote:
I will release the sources of ARGSS, but not right now. However, look this post I made http://www.hbgames.org/forums/viewtopic ... 22#p649622

OK. I did the same thing with PGE, no accessible code (no demo) before the license :)

Quote:
Win32API can be included with require, but I will add it internaly to the library. See this: http://www.hbgames.org/forums/viewtopic ... 75#p649275

Good, thank you ! :)

Quote:
I will include ZLib, remember that this will work the same as RMXP/RMVX plus some extra things. Actualy, it is already included for loading .png graphics, but it isn't available for ruby, hehe. I will add it.

OK :). By the way, on Ruby where is Zlib ? When I execute my .rb files which use Zlib, I don't have any problem (if I don't put require 'Zlib') whereas when I create my .exe file, Zlib isn't included anymore...

Quote:
Regarding the Ruby version, I am using right now 1.8.6, and I will update to 1.9.1 when I can make it work, I still can't do so, but I haven't worked on that really much...
If version 2.00 comes out, I will also see to upgrade to it.

OK :)
So, we can't change easily Ruby version...
the zlib library is a .so file that you can find in the folder:
ruby_install/lib/ruby/site_ruby/1.8/i386-msvcrt/

but for ruby 1.9.x, I think it's different: ruby_install/lib/ruby/1.9.1/i386-mswin32
Quote:
the zlib library is a .so file that you can find in the folder:
ruby_install/lib/ruby/site_ruby/1.8/i386-msvcrt/

Thanks :)
I'm on Ruby 1.8.6, but I think I'll download 1.9.1...

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=64236