Ultima Online Paperdoll Drawer
A PHP library to draw Ultima Online characters' paperdoll images., (*1)
, (*2)
Requirements
- PHP >= 7.1
- GD extension
- These Ultima Online client files (you need to provide them from your UO installation):
gumpidx.mul
gumpart.mul
tiledata.mul
hues.mul
Installation
Via composer:, (*3)
$ composer require ppardalj/ultima-paperdoll-drawer-php
Usage
Ultima Online client files
You need to provide your Ultima Online client MUL files and place them into the uofiles directory. If you're using a newer Ultima Online installation and your client files are UOP format, you'll need to use a tool (such as LegacyMulConverter) to convert your files to MUL format., (*4)
Code
Once your MUL files are placed, in your PHP script use the class PaperdollBuilder to customize the paperdoll of your character. You can use a fluent interface to change the name, title, skin hue, race, gender, and add items., (*5)
Finally, get an instance of the PaperdollDrawer class configured with your Ultima Online client files, and use it to draw the paperdoll you just built., (*6)
You will get an image resource which you can use the way you want., (*7)
$drawer = PaperdollDrawer::with('/path/to/uofiles');
$paperdoll = PaperdollBuilder::create('Lord Semerkhet')
->withTitle('Legendary Developer')
->withItem(new Item(9860, 1109, Layer::NECK)) // Hooded shroud of shadows
->build();
$paperdollImage = $drawer->drawPaperdoll($paperdoll);
imagepng($paperdollImage, 'mypaperdoll.png'); // save to png file
You can find more examples in the examples directory., (*8)
Contributing
Please feel free to report any bug you find, or submit a pull request with new features, bug fixes, etc., (*9)
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version., (*10)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details., (*11)
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*12)