Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

[20 December 2015] Added BlockInput, ReleaseSprite. Modified CreateSprite.


  • This topic is locked This topic is locked
No replies to this topic

#1
Feretorix

Feretorix

    Administrator

  • Administrators
  • 3,159 posts
CreateSpriteFromFile("filename.png",1.5); --function creates a sprite from a filename in your sprites folder, scaling is optional (in this case 1.5); function returns spriteID if success.
 
ReleaseSprite(index); --function releases a sprite from memory, returns true (bool) on success.
 
BlockInput(true/false); --function which blocks all possible input (mouse/keyboard) into the league game client. Shall be only used while a script menu is active, and shall be deactivated when the menu is closed.
 
 
Some code examples:
 
 
local myspritefileID = 0


OnDraw(function(myHero) --myHero is a pointer to our champion;

if myspritefileID > 0 then
	DrawSprite(myspritefileID,51,51,500,0,585,25,ARGB(255,255,255,255)); --draw a specific portion of the sprite file at X=51 and Y=51
	DrawSprite(myspritefileID,171,171,0,0,0,0,ARGB(255,255,255,255)); --draw the whole sprite file at position X=171 and Y=171
	end

local shiftpress = KeyIsDown(0x10); --Shift Key
if shiftpress then
	if myspritefileID > 0 then
		ReleaseSprite(myspritefileID);
		myspritefileID = 0;
		end
	BlockInput(true);
	end
local tabpress = KeyIsDown(0x14); --CAPS key
if tabpress then
	if myspritefileID == 0 then
		myspritefileID = CreateSpriteFromFile("filename.png",1.5);
		end
	BlockInput(false);
	end

end)
 
 

  • 1




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users