simple image style for button...

Place to get help with not working mods / modding interface.
noisy
Burner Inserter
Burner Inserter
Posts: 12
Joined: Sun Nov 02, 2014 9:38 am
Contact:

simple image style for button...

Post by noisy »

I cant figure it out yet... how One adds picture to a gui button?

gui example:

Code: Select all

game.oninit(function()
   td_gui = game.player.gui.left.add{type='frame', name='statistics', caption='statistics', direction='vertical'}
	td_gui.add{type='button', name='turret', caption="turret", colspan=2}
	td_gui.add{type='button', name='laser', caption="laser", colspan=2}
end)

game.onevent(defines.events.onguiclick, function(event)
	if event.element.name == "turret" then
		game.player.insert({name="gun-turret", count="1"})
	end

	if event.element.name == "laser" then
		game.player.insert({name="laser-turret", count="1"})
	end
end)
i want those 2 buttons have corresponding images on them.. gun-turret and laser-turret.
Post Reply

Return to “Modding help”