[Request] Script for change face width and height everywhere

Hello, I want to display every face more smaller than 96 pixels, I've tried already to decrease it by editting draw_face from Window_Base, but even if I decrease the size of the image manually with Photoshop, some places like the main menu and messages, the faces aren't displayed correctly.

I've placed the edited draw_face below all other script for ensure that is not an issue caused by other scripts, but the problem stills there.

Can someone do an script for change the faces width and height?

Thanks in advance.
Was this how you set it up?

Code:
class Window_Base < Window  def draw_face(face_name, face_index, x, y, enabled = true)    d_x, d_y = [96, 96]    bitmap = Cache.face(face_name)    rect = Rect.new(face_index % 4 * d_x, face_index / 4 * d_y, d_x, d_y)    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)    bitmap.dispose  end  end
When you ask for help with a script because you've tried and it's not working, you should at least show us what you tried. It could be a very small thing that needs to be fixed, or it could be totally wrong - we have no idea unless we see it.

Try this:

class Window_Base #-------------------------------------------------------------------------- # * Draw Face Graphic # enabled : Enabled flag. When false, draw semi-transparently. #-------------------------------------------------------------------------- def draw_face(face_name, face_index, x, y, enabled = true) bitmap = Cache.face(face_name) w, h = bitmap.width / 4, bitmap.height / 2 rect = Rect.new(face_index % 4 * w, face_index / 4 * h, w, h) pw, ph = (96 - w) / 2, (96 - h) / 2 contents.blt(x + pw, y + ph, bitmap, rect, enabled ? 255 : translucent_alpha) bitmap.dispose endendThis calculates the size of the face based on the size of the original image (which should contain 8 faces, as per the Ace default). You don't have to say the size anywhere.The pw and ph are to center it within the original 96x96 allocated space. Without it, they'll go to the top left corner of where the original face would have been displayed. So if you prefer that, just leave out anything about pw and ph.
Dont forget to change this part also

ss18.jpg
@Zetu Yes, what in the way you've wrote, but without adding dw and dy, just replacing directly the numbers, and didn't worked well.

---

@Shaz Sorry you're right, but sometimes I can't write everything because I have an schedule, if I not respect that I may have forbidden touch the computer (the disavantadge of live with your parents... their home, their rules y.y).

So, what must I change in your script? pw and ph changes the position, what I need is resize the faces to, for example, 72x72, without have to edit the default size, like an script that burandon did for me long time ago but for icons:

Code:
# Draw BIG Icon#----------------------------module ICON_SIZEICON_WIDTH = 96ICON_HEIGHT = 96endinclude ICON_SIZEclass Window_Basedef draw_icon(icon_index, x, y, enabled = true)bitmap = Cache.system("Iconset")rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)if ICON_WIDTH > 24     target = Rect.new(x - ICON_WIDTH / 4, y - ICON_HEIGHT / 4, ICON_WIDTH, ICON_HEIGHT)elsif ICON_WIDTH <= 24     target = Rect.new(x , y, ICON_WIDTH, ICON_HEIGHT)endcontents.stretch_blt(target, bitmap, rect)endend
You don't have to change anything. Just copy that script and paste it into a new slot in Materials. It will calculate the width and height based on the size of the image in the Faces folder.


This is the bit that decides how big the image is going to be:

Code:
w, h = bitmap.width / 4, bitmap.height / 2
That's for detect the size of the image and display it in the calculated size, that's not what I need, what I need is like the script I've posted for resize the icon size, I mean for example:

-Default Ace face file size is 384x192 (Eight faces of 96x96). Instead of display them at 96x96, change it to 72x72, original file is untouched (the file still being 384x192).

If you test the icon size script, you will see how the icons are bigger without have resized the iconset.

Anyways, I'll use your script in the meantime for continue adjusting my game UI, I really appreciate your help.

Thanks.
Oh, you want to SHRINK it to a different size? Okay - I thought you said you already changed the image to the correct size.


If you're familiar with scripting, look at the bitmap class in the help file. There's a blt_stretch function (I think that's what it's called) that will resize for you. However, don't expect it to look good.
My scripting knowledge is really low, all I know is put #, =begin, =end, and modify numbers, my field is story writer and event setups. I would like to learn script, but I don't have free time, for now is like I don't have own life (issues of live in parents home...).

Anyways, I'll take a look in the help file, maybe is something that will take a couple of minutes to made.
Do you want to resize ALL faces? Or do you want your face in the menus to be one size and in the message window to be another? What sizes do you want to use?

Try this:

class Window_Base #-------------------------------------------------------------------------- # * Draw Face Graphic # enabled : Enabled flag. When false, draw semi-transparently. #-------------------------------------------------------------------------- def draw_face(face_name, face_index, x, y, enabled = true, size = 96) bitmap = Cache.face(face_name) src_rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96) dest_rect = Rect.new(x + (96 - size) / 2, y + (96 - size) / 2, size, size) contents.stretch_blt(dest_rect, bitmap, src_rect, enabled ? 255 : translucent_alpha) bitmap.dispose end #-------------------------------------------------------------------------- # * Draw Actor Face Graphic #-------------------------------------------------------------------------- def draw_actor_face(actor, x, y, enabled = true) draw_face(actor.face_name, actor.face_index, x, y, enabled, 72) endendIf you want to show faces at the normal size, don't change the call (the message window is not changed here, so it defaults to 96x96). If you do want to change the size, pass in the new size as the last parameter (in the menu, faces are drawn at 72x72). Make sure, in that case, that you include ALL arguments.

If you faces in the menu screen to sometimes be 72 and sometimes be 96 (like 96 on the main menu but 72 on the status menu), further changes will be required.
Sorry for the late reply, I couldn't use the computer a single day this week.

I have an error on draw_actor_graphic (wrong number of arguments 6 for 5), draw_face works good.

Thanks.
I didn't do anything with draw_actor_graphic. Did you change it yourself? Look at the line that's in error - did you change that?
No, I haven't changed it, I meant draw_actor_face sorry.

draw_face works correctly, just needed some changes in the numbers for positionate the faces.
Check that you have pasted BOTH of those scripts, and that you don't have another script further down that also redefines either of those methods.


You should not be calling draw_face directly. You should only be calling draw_actor_face.


If you can't find anywhere that draw_face is redefined with only 5 parameters, show me a screenshot of these two methods in your script.

Original thread: https://forums.rpgmakerweb.com/threads/request-script-for-change-face-width-and-height-everywhere.17511/