[Resolved] Shrinking an Icon - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Code Support (https://www.save-point.org/forum-20.html) +--- Thread: [Resolved] Shrinking an Icon (/thread-3891.html) |
[Resolved] Shrinking an Icon - Yin - 01-11-2012 Hey, I was just wondering how I would shrink an icon. I have this right now: Code: bitmap = RPG::Cache.icon(item.icon_name) self.contents.font.color = normal_color self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 16, 16)) self.contents.draw_text(x + 20, y, width-80, 16, item.name) It makes the area 16x16, but the icon is still normal sized. RE: Shrinking an Icon - DerVVulfman - 01-11-2012 I use this to increase graphic sizes for a zoomed effect in my CharGen project Code: def resize(bitmapped,flag) rect is the rectangle holding the size/shape of your original rect2 is the rectangle of your shrunk/resized image bitmapped is your file and temp_bmp is your new one RE: Shrinking an Icon - Yin - 01-11-2012 I'm sorry, I sort of understand but how would I use this? resize("icon name", true) How does it know what size to switch to? NVM let me figure this out! :) I've been trying to teach myself. Thank you! Ok, so I've been here... trying to figure this out. This is the new method. Code: if item == nil It just comes up blank now. RE: Shrinking an Icon - NightOwl - 01-13-2012 I didn't know you edited your post. Last I saw was "gonna figure this out". I woulda come earlier had I known. Well, you commented out the line that pasted the revised icon and forgot to redo it after the resize. You also performed the resize, but didn't establish it as a new bitmap. I did a little editing as you can see here. Code: if item == nil RE: Shrinking an Icon - Yin - 01-13-2012 I'm going to try this out asap. For some reason, I thought that the stretch blt was standalone and did not need the regular blt call. RE: Shrinking an Icon - Victor Sant - 01-13-2012 the stretch_blt is stand alone, but you didn't apply it to the window content Change the Code: bitmap.stretch_blt(rect, bitmap,icon) to Code: self.contents.stretch_blt(rect, bitmap,icon) RE: Shrinking an Icon - Yin - 01-26-2012 Thanks I got it working properly. |