Comments (10)
Could you provide the code you used?
from scone.
Also, please provide version (eg master, 1.2, 2.0-pre) and OS
from scone.
yes, sure: 2.0-pre on Ubuntu 14.04 LTS in XFCE Terminal and
The error occured when placing the window.print() outside the loop in the function place_random.
import scone;
import std.random:uniform;
enum width = 40;
enum height = 20;
int xpos = width/2;
int ypos = height/2;
int[height][width] mirror;
void place_random(int num, wchar zeichen, Color fore_ground = Color.red, int value = 0){
for(auto j=0;j<num; j++){
auto rx = uniform(0,width);
auto ry = uniform(0,height);
window.write(rx,ry,fg(fore_ground),bg(Color.black),zeichen);
mirror[rx][ry]=value;
window.print();
}
}
void main()
{
window.resize(width,height);
window.clear();
for(auto x=0; x<width;x++){
for(auto y=0;y<height;y++){
window.write(x,y,bg(Color.black)," ");
}
}
window.print();
place_random(100,'\u2660',fg(Color.red),10);
place_random(400,'#',fg(Color.white_dark),-1000);
place_random(100,'\u2663',fg(Color.yellow_dark),20);
}
from scone.
I see you use wchar
in your code, which sadly isn't supported by scone. (I decided this sometime long ago because wchar and the windows console did not go well together).
If you change from wchar
to char
, does that "fix" your problem?
from scone.
ok, will try. How do I request if for example the 'r' key is pressed? My syntax seams to be wrong.
input.key == ??
from scone.
from scone.
Now I realized window.getInputs() seams to return nothing?
Any idea?
from scone.
Could you test with master branch?
I have only tested this with Mac/Ubuntu GNOME, so it could be the input not working at all :(
from scone.
Looks better!
Seams to work! Thank you!
Other question: Do you know how to speed up keys? I mean when holding a key pressed than it should repeat faster. something with xset -r ...
from scone.
Good to know! 2.0.0-pre.1 only handles a few macOS inputs. master supports almost all macOS/Ubuntu keys.
I'll close this issue, since the initial problem is resolved 😄
I do not believe repeat speed is something scone can set, as it is (I think) not handled by the terminal.
from scone.
Related Issues (20)
- "Unresolved external symbols" when compiling on Windows HOT 3
- Window resize detection HOT 4
- Settings HOT 2
- RGB color HOT 10
- Unittests HOT 2
- Resizing error with Windows Terminal HOT 3
- Release v3 HOT 3
- Mouse HOT 1
- Rename general Input to Keyboard HOT 1
- Hyper.js resizing not working
- Resizing mega-issue HOT 2
- Rework README HOT 2
- TextStyle HOT 6
- Styled text wrapper
- Improve POSIX output HOT 1
- RGB output on Windows HOT 2
- Enable POSIX style rendering on Windows HOT 2
- CLI-like output HOT 4
- Replace sconeSetup
- Release v3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scone.