The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: modern algebra on February 19, 2009, 10:57:10 PM

Title: Bitmap Addons 1.5
Post by: modern algebra on February 19, 2009, 10:57:10 PM
Bitmap Addons
Version: 1.5
Author: modern algebra
Date: August 21, 2009

Version History



Planned Future Versions



Description


This is a Scripter's Tool, not a standalone script. If you are not a scripter, then you will only want this script if it is used by a script that you do want.

This script adds methods into Bitmap for drawing ellipses, as well as one for drawing a straight line.

Features


Screenshots

(http://img172.imageshack.us/img172/8094/ellipseaddonca8.png)

Instructions

Please see header of the script for instructions

Script


Code: [Select]
#==============================================================================
#  Bitmap Addons
#  Version: 1.5
#  Author: modern algebra (rmrk.net)
#  Date: August 21, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#    This is a simple scripter's tool with methods added into Bitmap for drawing
#   ellipses, as well as one for drawing a straight line. The methods it adds
#   are:
#      outline_ellipse
#      fill_ellipse
#      fill_rounded_rect
#      draw_line
#      greyscale
#
#    It also allows you to change opacity and greyscale of blt and stretch_blt
#   externally with the public instance variables:
#
#      bitmap.ma_default_opacity = [0-255]
#      bitmap.ma_default_greyscale = false
#
#    These codes allow you to be able to change the opacity or greyscale what a
#   method like draw_character draws without overwriting it entirely. You want
#   it to draw the character opaque or grey if the character is dead? All you
#   need to do is change the default opacity or greyscale before running the
#   method.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#    To use this, simply put it above main. For some of these, it is necessary
#   to create an ellipse object and pass it as an argument. You can create an
#   ellipse with the code:
#
#     Ellipse.new (x, y, a, b)
#       x : the top left x position
#       y : the top left y position
#       a : the width of oval from origin to the side
#       b : the height of oval from origin. If nil, then a is radius of circle
#
#   There are four new methods added to bitmap that can be used:
#
#      outline_ellipse (ellipse[, colour, width, steps])
#        ellipse : the ellipse object being drawn
#        colour  : the colour of the outline. Assumed font colour if not specified
#        width   : the thickness of the line. Assumed 1 if not specified
#        steps   : can set a number of steps for increased accuracy. If not
#                  specified, it will estimate the number of steps
#
#      fill_ellipse (ellipse[, colour, steps])
#        ellipse : the ellipse object being drawn
#        colour  : the colour of the ellipse. Assumed font colour if not specified
#        steps   : can set a number of steps for increased accuracy. If not
#                  specified, it will estimate the number of steps
#
#      fill_rounded_rect (ellipse[, colour, w)
#        ellipse : the ellipse object being drawn
#        colour  : the colour of the outline. Assumed font colour if not specified
#        w       : the number of pixels at which to round the edge.
#
#      draw_line
#        x0      : the initial x coordinate
#        y0      : the initial y coordinate
#        x1      : the end x coordinate
#        y1      : the end y coordinate
#        colour  : the colour of the outline. Assumed font colour if not specified
#
#      greyscale (rect)
#        rect : the Rect object over which that part of the bitmap will be greyed.
#==============================================================================
# ** Ellipse
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Stores an ellipse object.
#==============================================================================

class Ellipse < Rect
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader   :h # The x position of the origin
  attr_reader   :k # The y position of the origin
  alias a width
  alias b height
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #     x : the top left x position
  #     y : the top left y position
  #     a : the width of oval from origin to the side
  #     b : the height of oval from origin. If nil, then a is radius of circle
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (x, y, a, b = nil)
    b = a if b.nil?
    super (x, y, a, b)
    @h = x + a
    @k = y + b
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Within?
  #    x : the x coordinate being tested
  #    y : the y coordinate being tested
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def within? (x, y)
    x_square = ((x - @h)*(x - @h)).to_f / (a*a)
    y_square = ((y - @k)*(y - @k)).to_f / (b*b)
    # If "radius" <= 1, then it must be within the ellipse
    return (x_square + y_square) <= 1
  end
end

#==============================================================================
# ** Bitmap
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    attr_accessor - ma_default_opacity, ma_default_greyscale
#    aliased methods - blt; stretch_blt
#    new methods - fill_ellipse; outline_ellipse; fill_rounded_rect; draw_line
#==============================================================================

class Bitmap
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :ma_default_opacity
  attr_accessor :ma_default_greyscale
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdnabr_dfltopac_init_bmpadon_2lh3 initialize unless $@
  def initialize (*args)
    # Initialize new public instance variable
    @ma_default_opacity = 255
    @ma_default_greyscale = false
    # Run Original Method
    mdnabr_dfltopac_init_bmpadon_2lh3 (*args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * BLT
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mnalgba_bitmapaddons_opacdflt_blt_2hb5 blt unless $@
  def blt (x, y, src_bmp, src_rect, opacity = @ma_default_opacity, grey = @ma_default_greyscale, *args)
    if grey
      src_bmp = src_bmp.dup
      src_bmp.greyscale (src_rect)
    end
    # Run Original Method
    mnalgba_bitmapaddons_opacdflt_blt_2hb5 (x, y, src_bmp, src_rect, opacity, *args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Stretch BLT
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modrnalgbra_strtchblt_bmpdons_opc_0lk2 stretch_blt unless $@
  def stretch_blt (dest_rect, src_bmp, src_rect, opacity = @ma_default_opacity, grey = @ma_default_greyscale, *args)
    if grey
      src_bmp = src_bmp.dup
      src_bmp.greyscale (src_rect)
    end
    # Run Original Method
    modrnalgbra_strtchblt_bmpdons_opc_0lk2 (dest_rect, src_bmp, src_rect, opacity, *args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Outline Ellipse
  #    ellipse : the ellipse being drawn
  #    width   : the width of the bar
  #    colour  : the colour of the outline
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def outline_ellipse (ellipse, colour = font.color, width = 1, steps = 0)
    # For neatness, define local variables a and b to the ellipse variables
    a, b = ellipse.a, ellipse.b
    # Use Ramanujan's approximation of the Circumference of an ellipse
    steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
    radian_modifier = (2*Math::PI) / steps
    for i in 0...steps
      t = (radian_modifier*i) % (2*Math::PI)
      # Expressed parametrically:
      #   x = h + acos(t), y = k + bsin(t) : where t ranges from 0 to 2pi
      x = (ellipse.h + (a*Math.cos(t)))
      y = (ellipse.k + (b*Math.sin(t)))
      set_pixel (x, y, colour)
    end
    # Thicken the line
    if width > 1
      ellipse = Ellipse.new (ellipse.x + 1, ellipse.y + 1, ellipse.a - 1, ellipse.b - 1)
      outline_ellipse (ellipse, colour, width - 1, steps)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fill Ellipse
  #    ellipse : the ellipse being drawn
  #    colour  : the colour of the outline
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def fill_ellipse (ellipse, colour = font.color, steps = 0)
    # For neatness, define local variables a and b to the ellipse variables
    a, b = ellipse.a, ellipse.b
    # Use Ramanujan's approximation of the Circumference of an ellipse
    steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0
    radian_modifier = (2*Math::PI) / steps
    for i in 0...(steps / 2)
      t = (radian_modifier*i)
      # Expressed parametrically:
      #   x = h + acos(t), y = k + bsin(t) : where t ranges from 0 to 2pi
      x = ellipse.h + (a*Math.cos(t))
      y = ellipse.k - (b*Math.sin(t))
      fill_rect (x, y, 1, 2*(ellipse.k - y), colour)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fill Rounded Rectangle
  #    rect    : the rectangle being drawn
  #    colour  : the colour of the outline
  #    w       : the number of pixels to cover by rounding
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #  Used to fill a rectangle with rounded corners
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def fill_rounded_rect (rect, colour = font.color, w = 8)
    # Draw Body of the rectangle
    fill_rect (rect.x + w, rect.y, rect.width - 2*w, rect.height, colour)
    # Draw Left Vertical Rect
    fill_rect (rect.x, rect.y + w, w, rect.height - 2*w, colour)
    # Draw Right Vertical Rect
    x = rect.x + rect.width - w
    fill_rect (x, rect.y + w, w, rect.height - 2*w, colour)
    # Make a circle
    circle = Ellipse.new (0, 0, w)
    for i in 0...w
      for j in 0...w
        # Upper Left Corner
        set_pixel (rect.x + i, rect.y + j, colour) if circle.within? (i, j)
        # Upper Right Corner
        set_pixel (rect.x + rect.width - w + i, rect.y + j, colour) if circle.within? (i + w, j)
        # Bottom Left Corner
        set_pixel (rect.x + i, rect.y + rect.height - w + j, colour) if circle.within? (i, j + w)
        # Bottom Right Corner
        set_pixel (rect.x + rect.width - w + i, rect.y + rect.height - w + j, colour) if circle.within? (i + w, j + w)
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Line
  #    x0, y0 : the coordinates of the start of the line.
  #    x1, y1 : the coordinates of the end of the line.
  #``````````````````````````````````````````````````````````````````````````
  #  This uses Bresenham's algorithm to draw a line
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_line (x0, y0, x1, y1, colour = font.color)
    # Set boolean for steep lines
    steep = (y1 - y0).abs > (x1 - x0).abs
    if steep
      # Reflect across y=x
      tmp = x0
      x0, y0 = y0, tmp
      tmp = x1
      x1, y1 = y1, tmp
    end
    # If in negative direction
    if x0 > x1
      # Swap initial points
      tmp = x0
      x0, x1 = x1, tmp
      tmp = y0
      y0, y1 = y1, tmp
    end
    ystep = y0 < y1 ? 1 : -1
    deltax = x1 - x0
    deltay = (y1 - y0).abs
    error = deltax / 2
    y = y0
    # Advance by Rows
    for x in x0.to_i...x1.to_i
      steep ? set_pixel (y, x, colour) : set_pixel (x, y, colour)
      error -= deltay
      if error < 0
        y += ystep
        error += deltax
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * GreyScale
  #    rect : the rect to greyscale
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def greyscale (rect = Rect.new (0, 0, self.width, self.height))
    # For each pixel in chosen rect of the bitmap
    for i in rect.x...rect.x + rect.width
      for j in rect.y...rect.y + rect.height
        colour = self.get_pixel (i,j)
        # Get the weighted average of the pixels for a proper shade of grey
        grey_pixel = (colour.red*0.3 + colour.green*0.59 + colour.blue*0.11)
        colour.red = colour.green = colour.blue = grey_pixel
        # Set the pixel to the new shade of grey
        self.set_pixel (i,j,colour)
      end
    end
  end
end

Credit



Thanks

This script uses:


Support


Please post here at rmrk.net for swiftest support.

Known Compatibility Issues

No known compatibility issues

Author's Notes


I wrote this a while ago for my Quest Journal, but since I intend to use it for other scripts, I thought it would be useful if it were released as standalone. I realize that these are probably not the most efficient ways to draw these basic geometric shapes, and I welcome any suggestions that would help me improve the algorithms used.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
Title: Re: Bitmap Addons
Post by: SolstICE on February 22, 2009, 05:49:40 AM
cool script modern algebra. going to get some use from me :)
Title: Re: Bitmap Addons
Post by: TDS on February 23, 2009, 06:32:24 PM
This is a pretty good add-on to the bitmap class. I was looking the other day for a way to fill objects and this should help figure out what I was doing wrong.
Title: Re: Bitmap Addons
Post by: worale on February 24, 2009, 05:26:58 AM
Very nice script. ^^
I haven't done anything further than fill_rect and draw_line in my life. :P
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on August 22, 2009, 03:38:55 PM
This script has now been updated to Version 1.5

There are a few new features:

A) added a greyscale method to bitmap, allowing you to grey a designated Rect object of the Bitmap.
B) added "default opacity" and "default greyscale" as public instance variables
C) changed blt and stretch_blt to function off of the new default values and added a boolean argument for greyscale. Basically, now, instead of opacity defaulting to 255, it defaults to the value of default_opacity. The arguments are now:
Code: [Select]
  bitmap.blt (x, y, bitmap, src_rect[, opacity = @ma_default_opacity[, greyscale boolean = @ma_default_greyscale]])
  bitmap.stretch_blt (dest_rect, src_bitmap, src_rect[, opacity = @ma_default_opacity[, greyscale boolean = @ma_default_greyscale]])
Title: Re: Bitmap Addons 1.5
Post by: Dec5952 on August 01, 2010, 06:55:18 PM
The same thing happens here as withyour catalogue base script.
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 11, 2012, 11:03:41 PM
Modern Algebra? how do i use the draw_line command?
it just says:
Code: [Select]
draw_line
#        x0      : the initial x coordinate
#        y0      : the initial y coordinate
#        x1      : the end x coordinate
#        y1      : the end y coordinate
#        colour  : the colour of the outline. Assumed font colour if not specified
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on March 11, 2012, 11:06:37 PM
It's:

Code: [Select]
draw_line(x0, y0, x1, y1, colour)

x0 and y0 are the coordinates of the start pixel, while x1 and y1 are the coordinates of the end pixel.

So:
Code: [Select]
draw_line (5, 8, 34, 17, Color.new(0, 0, 0))

would draw a black line from (5, 8) to (34, 17).
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 11, 2012, 11:19:25 PM
It's:

Code: [Select]
draw_line(x0, y0, x1, y1, colour)

x0 and y0 are the coordinates of the start pixel, while x1 and y1 are the coordinates of the end pixel.

So:
Code: [Select]
draw_line (5, 8, 34, 17, Color.new(0, 0, 0))

would draw a black line from (5, 8) to (34, 17).

i tried this in an event but it doesn't work (before i saw your post)
Code: [Select]
draw_line (x0, y0, x1, y1, colour)
x0 = $game_player.x
y0 = $game_player.y
x1 = $game_map.events[7].x
y1 = $game_map.events[7].y
colour = font.color
Title: Re: Bitmap Addons 1.5
Post by: cozziekuns on March 11, 2012, 11:20:33 PM
Really nice; used this before and it's come in handy.

Any chance of programming in anti-aliased lines, MA?
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 11, 2012, 11:38:29 PM
so how should i do this in an event ?
the command i used doesn't seem to work -_-"
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on March 11, 2012, 11:47:53 PM
Well, the method is in Bitmap, which means to do it you will need to make a sprite or window and draw it on the bitmap in that class.

@cozziekuns - I don't know if I will return to this script to do that, but if I make a VXA version I would, and then I would probably port it back to VX. I currently have no plans to do so though.
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 12, 2012, 12:28:21 AM
Well, the method is in Bitmap, which means to do it you will need to make a sprite or window and draw it on the bitmap in that class.

@cozziekuns - I don't know if I will return to this script to do that, but if I make a VXA version I would, and then I would probably port it back to VX. I currently have no plans to do so though.
could you give me an example for a sprite , whats the code? ^^
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on March 12, 2012, 12:36:35 AM
What do you mean? There are lots of sprites in the default classes.
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 12, 2012, 12:46:42 AM
What do you mean? There are lots of sprites in the default classes.
i mean that i would just like to create a line on the map scene but i don't know the code ^^
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on March 12, 2012, 12:54:02 AM
You have to create a new sprite, with a sufficiently large bitmap, position it to where you want it to be, then draw the line.

You don't want to do it directly through an event - it would be best to do it in Scene_Map and just have an event call initialize that process.

I don't really have the time to give you a tutorial on Sprites, but hopefully it suffices to give this example:

Code: [Select]
@line_sprite = Sprite.new
@line_sprite.bitmap = Bitmap.new(64, 64)
@line_sprite.x = 200
@line_sprite.y = 300
@line_sprite.bitmap.draw_line(0, 0, 32, 48, Color.new(0, 0, 0))

Obviously that's ugly and useless, but maybe it will give you an idea of what to do. If you want the sprite to be more dynamic it might be worthwhile to make a subclass of Sprite to handle the processing.
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on March 12, 2012, 01:12:27 AM
You have to create a new sprite, with a sufficiently large bitmap, position it to where you want it to be, then draw the line.

You don't want to do it directly through an event - it would be best to do it in Scene_Map and just have an event call initialize that process.

I don't really have the time to give you a tutorial on Sprites, but hopefully it suffices to give this example:

Code: [Select]
@line_sprite = Sprite.new
@line_sprite.bitmap = Bitmap.new(64, 64)
@line_sprite.x = 200
@line_sprite.y = 300
@line_sprite.bitmap.draw_line(0, 0, 32, 48, Color.new(0, 0, 0))

Obviously that's ugly and useless, but maybe it will give you an idea of what to do. If you want the sprite to be more dynamic it might be worthwhile to make a subclass of Sprite to handle the processing.

Thanks MA i'll take a look ;)
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on September 02, 2012, 07:03:43 PM
MA how would i make a line from one point to an other point, i'm trying to make a fishing system with variables and events :p
letting a line go from the player to an event/coordinates.
Title: Re: Bitmap Addons 1.5
Post by: modern algebra on September 02, 2012, 07:49:14 PM
I think I answered this question, didn't I?

Make a sprite and use the draw_line method on its bitmap.
Title: Re: Bitmap Addons 1.5
Post by: Mitsarugi on September 02, 2012, 08:02:13 PM
I think I answered this question, didn't I?

Make a sprite and use the draw_line method on its bitmap.
yeah well i never figured out how to get it to work :(
Title: Re: Bitmap Addons 1.5
Post by: Bradoki2 on October 19, 2012, 10:59:31 PM
Useful script, i like it so many script, modern algebra
Title: Re: Bitmap Addons 1.5
Post by: Kyuukon on April 14, 2015, 11:06:51 PM
I can't believe I'm actually in need for this... LOL! Never thought so >.<

I was really excited when I read this:
Quote
<Version 2.0> - polygon and pie features. So outline_polygon, outline_pie, fill_polygon, fill_pie, fill_area

only to then discover it's listed as 'planned future versions' T.T :(

Thanks for your awesomeness, MA!

Edit: VX? Buuuh :(
Edit2: Look at what I found: http://www.whiteflute.org/wfrgss/?mode=view&realmId=1&pageId=25#h5_simple_draw_pie28start_x2c20start_y2c20end_x2c20end_y2c20color202cstart_angle202c20sweep_angle202cfill202cwidth203d20129 :O