0.1.19 • Published 5 years ago

overhype v0.1.19

Weekly downloads
33
License
ISC
Repository
-
Last release
5 years ago
const oh = require('./index');
oh.structure();

oh.init();

let prefix = __dirname;
if(process.argv[2] == 'dev') prefix = '.';

const font = oh.loadFont(prefix + '/ttf/Caviar_Dreams_Bold.ttf', 40);
const fontSmall = oh.loadFont(prefix + '/ttf/Caviar_Dreams_Bold.ttf', 20);
const logo = oh.loadSurface(prefix + '/logo.jpg');

const window = oh.createWindow({
    title: 'overhype reviev',
    x: 10,
    y: 10,
    w: 1000,
    h: 600,
});

const pos = {
    x1: 200,
    y1: 500,
    x2: 0,
    y2: 0,
}

let i = 0;

oh.event.start();

const channel = oh.sound.channel();
console.log('channel:', channel);
oh.sound.play(oh.sound.load('./rude-eternal-youth.mp3'), channel, 1);
console.log('channel:', channel);
oh.sound.volume(channel, 128);


setInterval(() => {
    const mouse = oh.event.mouse();
    const Qpressed = oh.event.code(20) ? 'Key Q pressed on keyboard' : 'Please press Q on keyboard';
    
    
    if(mouse.x > 970) {
        oh.quit();
        process.exit(0);
    }
    
    
    oh.fillRect(window);

        
    pos.x2 = pos.x1 + Math.cos(i / 30) * 80;
    pos.y2 = pos.y1 + Math.sin(i / 30) * 80 - mouse.y / 70;

    //oh.spm.rect(window, pos.x1 - mouse.x / 10, pos.y1 - mouse.y / 10, pos.x2 - mouse.x / 10, pos.y2 - mouse.y / 10);
    //oh.spm.grid(window, pos.x1 - mouse.x / 10, pos.y1 - mouse.y / 10, pos.x2 - mouse.x / 10, pos.y2 - mouse.y / 10, 4);

    //oh.blitSurface(logo, undefined, 0, { x: 100 - mouse.x / 200, y: 100 - mouse.y / 200 });
    oh.spm.rotatedSurface(logo, 0, { x: 500 - mouse.x / 200, y: 240 - mouse.y / 200 }, 0, 1, 1 );

    oh.bindFont(font);
    oh.spm.blendedText(window, 'This is OverHype', 600 - mouse.x / 100, 430 - mouse.y / 100);
    oh.bindFont(fontSmall);
    oh.spm.blendedText(window, 'Move mouse to left side to exit', 600 - mouse.x / 10, 500 - mouse.y / 50);
    oh.spm.blendedText(window, Qpressed, 300 - mouse.x / 100, 550 - mouse.y /30);

    oh.updateWindowSurface();

    //console.log(oh.event.pressed());

    i++;
}, 10);
//prints all functions
oh.structure();

//return the manual
console.log(oh.manual());
packege.json:
    "node-gyp": "^3.8.0"

run.sh:
    npm i node-gyp
    npm i nan --save
    node-gyp configure build
    node ./index.js
v8::String::Utf8Value s(args[0]);
std::string title(*s);
std::cout << title << " aaa\n";
*/

/*
args[0].As<v8::Uint32>()->Value()
*/

/*
    int main(int argc, char **argv)
    {
        std::map<Uint32, SDL_Surface*> surfaces;
        m["hello"] = 23;
        // check if key is present
        if (m.find("world") != m.end())
            std::cout << "map contains key world!\n";
        // retrieve
        std::cout << m["hello"] << '\n';
        std::map<std::string, int>::iterator i = m.find("hello");
        assert(i != m.end());
        std::cout << "Key: " << i->first << " Value: " << i->second << '\n';
        return 0;
    }
*/
0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago