← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #194581]: Creating an image library/patterns in java

 

Question #194581 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/194581

    Status: Open => Answered

RaiMan proposed the following answer:
I do not understand this big effort ;-)

As I understand the challenge:

You want to say something like
myPattern("back")
and this be a pattern object created as:
new Pattern( "D:\SIKULI\library.sikuli\back.png");

So make yourself a function, that returns a new Pattern object.

static String images = "path-to-image-repository";

static Pattern myPattern(String image) {
    Pattern p = new Pattern(images+image+".png");
    return p;
}

so taking your first example:

saveLocation = myPattern("save_location")

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.