Is there a way to "cut" an image?

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Mon Jul 21, 2014 2:26 pm

need to fix.png
need to fix.png (117.17 KiB) Viewed 1948 times
As you can see here I have a ship image but because the sprites are together other ships are showing as well. Is it possible to cut the extra ships them out?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.

User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Tue Jul 22, 2014 7:34 pm

Interesting question. I tried using a canvas-element in an items image:

Code: Select all

<Image>
			<Canvas>
				(cnvDrawImage 0 0 (list &rsItems1; 192 96 96 96))
			</Canvas>
		</Image>
but it doesn't work. It would be very useful functionality though.

~Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de

User avatar
FAD
Militia Captain
Militia Captain
Posts: 732
Joined: Thu Aug 10, 2006 5:33 am
Location: Area 51

Wed Jul 23, 2014 8:31 am

Use a graphics editor such as Paint Shop Pro, Photoshop...etc. and scan the demensions of the image that you want (be sure to scan the complete image and a slight border around it), then scale those demensions into your XML file pertaining to the unit you're using. Unless that's changed in recent versions, that's how I've always set individual images from sprite sheets in game.

User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Thu Jul 24, 2014 12:12 am

FAD wrote:Use a graphics editor such as Paint Shop Pro, Photoshop...etc. and scan the demensions of the image that you want (be sure to scan the complete image and a slight border around it), then scale those demensions into your XML file pertaining to the unit you're using. Unless that's changed in recent versions, that's how I've always set individual images from sprite sheets in game.
In this case he can just lift the dimensions from the image tags in the ship definitions.
Literally is the new Figuratively

User avatar
FAD
Militia Captain
Militia Captain
Posts: 732
Joined: Thu Aug 10, 2006 5:33 am
Location: Area 51

Thu Jul 24, 2014 12:56 am

Atarlost wrote:
FAD wrote:Use a graphics editor such as Paint Shop Pro, Photoshop...etc. and scan the demensions of the image that you want (be sure to scan the complete image and a slight border around it), then scale those demensions into your XML file pertaining to the unit you're using. Unless that's changed in recent versions, that's how I've always set individual images from sprite sheets in game.
In this case he can just lift the dimensions from the image tags in the ship definitions.
Yup, that's true as well. Although giving that posted image a second look, each ship class displayed appears to be 4x greater than it should be, so it looks like a scaling problem where it should be scaled down 1/4th its size, so each ship will fit properly....and individually.

User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Thu Jul 24, 2014 8:17 am

I'm pretty sure RPC knows how to scale, resize, cut and recreate new images at the desired dimensions :-) My guess is that he would like to (re)use the standard ship sprite images (which have both varying dimensions and are surrounded by other frames in the sprite) as an item image in the itempicker dockscreens, without introducing any extra resources.

So, in effect, he would like a method to 'cut' a frame from a sprite and display it at the centre of a 96x96 pixels area using either scripting or xml.

Cheers,
Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de

PM
Fleet Admiral
Fleet Admiral
Posts: 2460
Joined: Wed Sep 01, 2010 12:54 am

Thu Jul 24, 2014 12:27 pm

pixelfck wrote:My guess is that he would like to (re)use the standard ship sprite images (which have both varying dimensions and are surrounded by other frames in the sprite) as an item image in the itempicker dockscreens, without introducing any extra resources.
Same here. Also, I would like to scale such images as well. For example, scaling a capital ship to fit within 96x96, or scaling items to 24x24.
Download and Play in 1.9 alpha...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
Playership Drones (WIP): Acquire more wingmen from Ship Broker. Unfinished, but updated to 1.8 beta.
Drake Technologies (Alpha) for 1.8: If you do not have 1.9 alpha 1...

User avatar
FAD
Militia Captain
Militia Captain
Posts: 732
Joined: Thu Aug 10, 2006 5:33 am
Location: Area 51

Fri Jul 25, 2014 8:04 am

pixelfck wrote:I'm pretty sure RPC knows how to scale, resize, cut and recreate new images at the desired dimensions :-) My guess is that he would like to (re)use the standard ship sprite images (which have both varying dimensions and are surrounded by other frames in the sprite) as an item image in the itempicker dockscreens, without introducing any extra resources.

So, in effect, he would like a method to 'cut' a frame from a sprite and display it at the centre of a 96x96 pixels area using either scripting or xml.

Cheers,
Pixelfck
Right, considering that he's using a dockscreen that's utilizing the itempicker, those ship images are being treated as items (or the demensions commonly used for items.) That is why there's 4 images being displayed in each 'item' within that dockscreen. The displayed ship images are from the actual ship rotation sprite sheet, not from the items sprite sheet. So what I think is needed here is a way to scale the images within the dockscreen code based on each ship image demensions. Either that or having to resort to creating a complete new sprite sheet having all the ship images scaled to the demensions of items. Or, unless there's already a code somewhere (that I'm not aware of) maybe George could fix/code it to where we could use ship images (or any image) in dockscreens that use the itempicker.

Post Reply