Closed ashes999 closed 9 years ago
I just looked at your event. From what I can tell, you are using the script "Ace Message System."
What are you looking for exactly? Do you want something like giveItem(itemID)
to automatically do everything?
i.e. something like this?
The giving of the item can be done separately. I just need some way to show the message window with the image and text centered, like the fake screenshot in this issue.
Ah. I should've tested it thoroughly before posting a bag of ignorance.
So this this the actual image:
Last question; can I assume the given image will be rotated?
Oh you really are back alhamdulillah :)
Yes, you can assume the image is already rotated.
Don't worry about bags of ignorance. This entire idea is poorly-defined and this is finally when we figured it out (by faking screenshots and showing them to our artist).
Issues left:
Did you have time to work on this @Haris1112 ?
I have a midterm on friday, after which I should be relatively free. Was this an urgent task?
Nope. Just thought eight days is a long time for you to go without posting updates :)
lol :)
Well here's my game-plan:
1 Look at the drawing code that is used in the custom script.
2 Adjust the draw method of Draw Icon / Draw Text to center text.
Yaay, I centered the sword!
I have no idea how to center the text yet.
Anyway, I found the documentation to rgss3!! It's in the script editor -> help button! Also I changed the AceMessageSystem in a way where all \pic usage will result in centered images.
when 'PIC'
text.sub!(/\[(.*?)\]/, "")
msgbox($1)
bmp = Cache.picture($1.to_s)
rect = Rect.new(0, 0, self.width, self.height)
contents.blt(self.width/2 - bmp.width/2 - self.padding, 0, bmp, rect)
I could add another condition during the checking of \commands
: example:
when 'PIC_C'
..
..
that way, \pic_c would center a picture :trophy:
Whoa, low-level drawing APIs. I'm not sure I approve, but okay, mashaAllah good find :D
O.o I thought this was high level. Isn't low level when it's closer to the 1's and 0's?
How would you like it? Something like show(image_in_pictures_folder, message)?
blt is a pretty low-level operation. I don't mind it, I just prefer avoiding low-level stuff where possible. If it works, it works, I'm not complaining :)
ok :)
Kay it's done :cake:
In the event text, you have to use this:
\pic[inventory\\sword-inventory]
\ct[Found a sword!]
And these are the (minor) changes to the AceMessageSystem.
when 'PIC'
text.sub!(/\[(.*?)\]/, "")
bmp = Cache.picture($1.to_s)
rect = Rect.new(0, 0, self.width, self.height)
contents.blt(self.width/2 - bmp.width/2 - self.padding, 0, bmp, rect)
when 'CT'
text.sub!(/\[(.*?)\]/, "")
rect = Rect.new(0, pos[:y], self.width - 2 * self.padding, self.height)
contents.draw_text(rect, $1.to_s, 1)
Is it possible to wrap this into a single script call? Something like your suggested show(image_in_pictures_folder, message)
which appropriately uses \pic
and \ct
. You can use the show_message
API call for this, I believe (see: unofficial API guide)
okay I'll try
The API call doesn't parse the text correctly though it comes out exactly as the input.
I tried creating a window_message but it doesn't want to show! I need to take a break :P
I'm sure you can figure something out :) it's not a big deal if you can't do this though
So this is done? @Haris1112
almost, i created my own module. and will just implement the drawing function therein
(ping)
Is there any work left here?
Yea, I'm wrapping the script call around a method. Last time I tried the show_message show_message API call, but it didn't work. So if I just have another \function
to do the centering, I think it would be better - it will preserve the original \pic
functionality.
@Haris1112 mashaAllah I know you've moved on to other things. Can you please wrap this up so you don't have any loose ends left for ADAAN?
I've changed the text of the blacksmith-sword event to the following:
\nc\cpic[inventory\\sword-inventory]
\ct[Found a sword!]
When you get items, avatars appear in the message window.
Like this: