Scripts / PasteSprite

Author
Message
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 30th Jul 2017 09:07
I have a sprite which displays ok in 1920x1080 using pastesprite, but when I work on my laptop and run at 1280x720 the sprite is NOT scaled automatically and is not displayed only part of it is shown the rest is off screen.

Is there anyway that GG can detect resolution and scale sprite correctly. ?
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 30th Jul 2017 09:31 Edited at: 30th Jul 2017 09:32
Did you use SetSepriteSize(ID,x,y)?
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th Jul 2017 09:45
Ate you sure you're using sprite commands for it and not the image commands? Because the sprite commands work off of screen ℅ so should always scale.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 30th Jul 2017 11:00
@smallg - SetSpriteSize(ID,-1,-1) if im correct keeps the size and aspect ratio of sprite?
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 30th Jul 2017 11:20
hmmmm nothing I try is scaling the sprite at all?

Can the resolution be read and a scale percentage be worked out for scaling any sprite?
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th Jul 2017 13:54 Edited at: 30th Jul 2017 13:54
Sprite size has two numbers, the first is the screen % for the X axis of the sprite, the second is the screen % for the Y axis of the sprite.

So if you use SetSpriteSize(ID,90,50) the sprite will take up 90% of the width of the screen, and the height will take up 50% of the screen.

Then you use SetSpritePosition(ID,X,Y) to set the position of the sprite (can't remember if it's the top left or the centre of the sprite), again it's in % of the screen.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 30th Jul 2017 14:32
right ok belidos thanks i will try that. I didn't think of that. I thought it was to just keep aspect ratio correct.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 30th Jul 2017 15:03
Yeah, I think the -1,-1 thing only keeps the original shape and size of the sprite, it doesn't scale (I could be wrong though)

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 30th Jul 2017 16:04
belidos - that was it just put some numbers in there instead of -1,-1 and it scaled thanks mate
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 30th Jul 2017 16:25
The way the numbers work is if one is set to size and the other is -1 the ratio will be kept, so if you want the sprite to keep its ratio (if for example it's a circle) and you want it to take up half the screen vertically then it would be -1, 50.

Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-12-23 00:27:19
Your offset time is: 2024-12-23 00:27:19