This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
// Load the texture for the sprite | |
sf::Texture texture; | |
if (!texture.loadFromFile("file.png")) { | |
return EXIT_FAILURE; | |
} | |
// Make drawable sprite using texture | |
sf::Sprite sprite(texture); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
while (window.isOpen()) { | |
sf::Event event; | |
while (window.pollEvent(event)) { | |
switch (event.type) { | |
case sf::Event::KeyPressed: | |
cout << event.key.code; | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
while (window.isOpen()) { | |
sf::Event event; | |
while (window.pollEvent(event)) { | |
switch (event.type) { | |
case sf::Event::MouseButtonPressed: | |
cout << event.mouseButton.button << " button was clicked"; | |
break; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
while (window.isOpen()) { | |
sf::Event event; | |
while (window.pollEvent(event)) { | |
switch (event.type) { | |
case sf::Event::MouseButtonPressed: | |
cout << "Button " << event.mouseButton.button << " @ " | |
<< sf::Mouse::getPosition(window).x << ", " | |
<< sf::Mouse::getPosition(window).y << "\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
// Load the sound file | |
sf::Music sound; | |
if (!sound.openFromFile("soundfile.ogg")) { | |
return EXIT_FAILURE; | |
} | |
// Play the sound | |
sound.play(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('.headerStatus[id^=Row]').each(function() { Fion.deleteItem(jQuery(this).attr('id').replace(/Row.*_/, 'deleteItem_')) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS > cmd /c mklink /d "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\player" "C:\Users\{your_username}\Dropbox\Starbound\player" | |
PS > cmd /c mklink /d "C:\Program Files (x86)\Steam\SteamApps\common\Starbound\universe" "C:\Users\{your_username}\Dropbox\Starbound\universe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ln -s ~/Dropbox/Starbound/player ~/Library/Application\ Support/Steam/SteamApps/common/Starbound/player | |
$ ln -s ~/Dropbox/Starbound/player ~/Library/Application\ Support/Steam/SteamApps/common/Starbound/universe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://www.codewars.com/kata/54592a5052756d5c5d0009c3/train/haskell | |
module ListOps where | |
import Prelude hiding (head, tail, init, last) | |
head :: [a] -> a | |
head (x:_) = x | |
tail :: [a] -> [a] | |
tail (_:xs) = xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glitch = require('glitch-canvas'); | |
const canvasCover = require('./lib/canvas-cover.js'); | |
const canvas = document.getElementById('canvas'); | |
sizeCanvas(); | |
const ctx = canvas.getContext('2d'); | |
const image = new Image(); | |
image.src = '/assets/images/stock.jpg'; |
OlderNewer