I tried this with two, with no luck. It seems to default to the one selected in preferences with no joy.
2. PGraphics, PFrames
The other options seem to be more code, either PGraphics buffers or PFrames;
https://forum.processing.org/topic/present-full-screen-mode-stretched-across-multiple-screens
Hello,
(I've edited this for clarity,again!)
I’m building a live voting table and I have a problem with the logic.
There are three displays; Entry, Voting, and Display
Entry - In my program, you can enter strings, which are assigned a value of 0.
Voting - You can vote on these strings (up and down) in a second area.
Display - in the third area, a score table displays entries live in the order of the amount of votes they have
I do this with an entries ArrayList and an entriesVotingArray
An entriesVotingArray is created from the Entries ArrayList with frequent refreshes to capture new entires.
That Array is sorted to display entries one-by-one for voting.
I want to vote on;
Newest entries first,
Unvoted entries next,
Voted entries by age or randomly,
I’d like new entries to be always next on the list, and if there are none, a random selection that loops.
I have a VotingScreen Class and a VotingSorting Class;
In VotingSorting I have comparators that sort an Array fed by the entries ArrayList that is refreshed frequently by the Voting Screen above…
My problem is that when I have voted 14 times (the current size of ArrayList and Array) the entry presented for voting doesn’t change anymore.
I can still vote, and new entries will interrupt and display to be voted on, but it goes back to the previous entry after voting and I’m stuck.
Can anyone see how I can start giving random entries when I am stuck like this?
(BTW, I am using Number variable, but I am keeping that = 0 and doing everything by sorting the array for unvoted entries to feed the next entries to the top of the index (0). I guess the problem is moving to a randomised entry if there are no new (unvoted) entries. Does anyone know how I can put a break in there if it gets stuck???). New entries break in ok....
Hi all,
i have a code fragment I am referencing (credit given below) and I would like to use a returned value from it in the main draw.
However, it doesn't seem to be returned , except as zero perhaps. it's the calculateTextHeight below that I want. It would seem to be returned as textHeight unless I am wrong.
I'm using the below fragment in a class called Node, and am calling other values from the class in draw, but this one has me stumped.
It's a float if that matters, but I feel I am doing something basic wrong.
//from steven http://processing.org/discourse/beta/num_1195937999.html
int calculateTextHeight(String nodeString, int specificWidth, int fontSize, int lineSpacing) {
String[] wordsArray;
String tempString = "";
int numLines = 0;
float textHeight;
wordsArray = split(nodeString, " ");
for (int i=0; i < wordsArray.length; i++) {
if (textWidth(tempString + wordsArray[i]) < specificWidth) {
tempString += wordsArray[i] + " ";
}
else {
tempString = wordsArray[i] + " ";
numLines++;
}
}
numLines++;
textHeight = numLines * (textDescent() + textAscent() + lineSpacing);
return(round(textHeight));
}
}
Hello,
I try to keep the questions until I am really stuck!
I have a sketch I am doing of what I want to be rectangles generated by a list read in by strings (eventually an arrayList so I can add to it). The rects and strings are in a class called node with an array to iterate, and I have code to word wrap the strings and adjust the height of the rects.
Now I am trying to find out the best way to make the heights and width of the rects available and get the x and y positions of the rects (a class called Node) so I can draw lines linking them.
I have had thoughts to makes the lines part of the Node class and iterate them with i, but without much luck, also looked at PVector but could not really get my head around returning the values needed and using them with the line draw in the right place (in draw, or class?).
Also, I am aware that maybe I don't have the rect Node movement code in the best place for this, as I can never seem to access one value or the other in draw even if I do a return value, be it the rect position for lines, or height and width for bouncing it off walls and other rects.
I've looked at a lot of code and reference material, but could really use an experienced eye to look and give me a steer. PVector? ArrayList? i and j? Return x and y values in some spot? I tried to return them in class and access in draw with no luck.
So I am looking for the most sensible way to draw lines between these nodes and the most logical place to put the movement code.
Many thanks if you could help. - the // line is the pseudocode I would like to work, and I would also like height/width to be accessable while still using the height generating code in the class! line 75 on is credited to a processing user and is the height code.
PS. I have looked at this;
https://forum.processing.org/topic/circles-with-lines-connecting-farthest-neighbor
But again, the same issue of making rects from a string list and generating heights from that confuses it.
Hello,
I've hit a wall. I know I am doing something stupid, but cannot find the exact location of the illogical act. :)
The result I am after is an array of rectangles with a different line of text in each.
For future reasons, I am using Strings for the text.
So I have a Node class defined by array that takes in the string from an array (fed in via an argument) and creates a rect with the string in (there is further code to word wrap and line space as defined in the arguments).
It works for the first rect and string node, but further ones in the array do not have the next text string, but all of them. So defining 2 nodes gives 2 nodes of 2 rects with the first 2 lines of text in each. 3 gives, 3, 3, and 3, etc.
Lines 65-on can be ignored, as they are not germane to the problem....
I suspect where I am going wrong is here on line 25-26, but cannot prove it:
for (int i = 0; i < myNode.length; i++) { myNode[i] = new Node (newString[i],150,8); }
Can anyone see the obvious howler?