Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ekranayar(lua_State *ls){
- ekranx = lua_tonumber(ls,1);
- ekrany = lua_tonumber(ls,2);
- ekranstr = lua_tonumber(ls,3);
- if(ekranx < 1)ekranx = 1;
- else if(ekranx > 79)ekranx = 79;
- if(ekrany < 1)ekrany = 1;
- else if(ekrany > 83)ekrany = 83;
- //windowSize = {0, 0, ekranx, ekrany};
- // SetConsoleWindowInfo(console, 1, &windowSize);
- //SetConsoleWindowInfo(buffer, 1, &windowSize);
- //cursor.bVisible = false;
- //SetConsoleCursorInfo(hConsole,&cursor);
- for(int y=0;y<ekrany;y++){
- for(int x=0;x<ekranx;x++){
- ekranR[x][y]=256;
- }
- }
- SetConsoleActiveScreenBuffer(buffer);
- HWND console = GetConsoleWindow();
- RECT r;
- GetWindowRect(console, &r); //stores the console's current dimensions
- MoveWindow(console, r.left, r.top,300, 300, TRUE); // 800 width, 100 height
- return 1;
- }
- int ekranbas(lua_State *ls){
- SetConsoleCursorPosition(hConsole,{0,0});
- for(int y=0;y<ekrany;y++){
- for(int x=0;x<ekranx;x++){
- if(ekranR[x][y]==256)SetConsoleTextAttribute(hConsole,ekranstr);
- else SetConsoleTextAttribute(hConsole,ekranR[x][y]);
- //printf("%c",ekran[x][y]);
- WriteConsole(hConsole,L" ",1,&writen,NULL);
- }
- //printf("\n");
- WriteConsole(hConsole,L"\n",1,&writen,NULL);
- }
- SetConsoleTextAttribute(hConsole,7);
- SetConsoleActiveScreenBuffer(hConsole);
- swap(hConsole,buffer);
- SetConsoleTextAttribute(buffer,7);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement