LIBGDX: Where is AssetManager.isLoaded(AssetDescriptor)? Why there is none? - libgdx

I know I can use AssetManager.isLoaded(AssetDescriptor.filename, AssetDescriptor.type).
But, why there is no AssetManager.isLoaded(AssetDescriptor)method?

Related

Unable to Access DIV element using Watir

Hi I am trying to access the DIV element using watir but I am unable to do that,I have tried in different ways but couldn't access it,may be I think it need to be access through some parent element can anyone help me out?
My system Configurations
IE-8
Windows 7
I tried with the below command
#ie.div(:text,'COMPOSE').click
the command gets execute with no errors but no action is performed on the UI
The best solution appears to be switching to Watir-Webdriver. With Watir-Webdriver, #ie.div(:text,'COMPOSE').click will work as expected.
Assuming that is not an option, there are a couple of reasons why that same command does not work with Watir(-Classic) v1.6.7:
The first problem is that #ie.div(:text,'COMPOSE').click will find the first div that contains this text. This would be one of the ancestors of the div you want. As a result, Watir will send the click event against the wrong element.
The second problem is that the div is not responding to the onclick event fired by Watir. I am not sure why this problem exists.
To solve the first problem, you will need to be more specific when locating the div. In this case, the "role" attribute can be used since none of the ancestor elements have this attribute. Watir-Classic does not support using the role attribute as a locator. As a result, you will need to create a custom locator using an element collection and the find method:
#ie.divs.find{ |div| div.attribute_value('role') == 'button' && div.text == 'COMPOSE' }
To solve the second problem, it turns out that double clicking does work. While newer versions of Watir-Classic have a double_click method implemented, it does not exist in 1.6.7. You can replicate the method by calling the fire_event method:
.fire_event('ondblclick')
Putting it all together, the following will click the compose button:
#ie.divs.find{ |div| div.attribute_value('role') == 'button' && div.text == 'COMPOSE' }.fire_event('ondblclick')
There may be more than one element on the page with the text 'COMPOSE', some may be hidden. Try:
#ie.divs(:text,'COMPOSE').size
That is divs with an s.
Then you can try something like the following and see if you get a change in the UI:
#ie.divs(:text,'COMPOSE').each { |b| b.fire_event('click') }
I remember that fire_event works better, but would recommend consulting the docs for the difference between .click and fire_event.

Is there an easy way to get access to a component from anywhere?

Right now i'm doing something like this:
function getChartPages() {
return document.querySelector("dashboard").shadowRoot.querySelector("#panelA").shadowRoot.querySelector("#panelA3").shadowRoot.querySelector("#panelA3south");
}
I wonder if there's an easy way to achieve the same thing...
document.querySelector('dashboard /deep/ #panelA3south') would get you want you want. You can also use ::shadow in qS().
It's worth noting that 'dashboard' is not a valid custom element name. There needs to be a "-" in the name.

Is there a way to highlight element with Watir?

I keep getting errors doing this:
puts browser.table(:after? => span(:text => "Asmeniniai duomenys") )[2][2].text
basically saying:
undefined method `span' for main:Object (NoMethodError)
or
undefined method `table' for main:Object (NoMethodError) etc...
so I decided that the table was not found. I tried if/else, but it's the first time I used ruby, I did not understand if it worked or not.
So I thought that the simplest way would be to find out how to highlight something.
Could anyone suggest how can I highlight elements or how to fix this problem?
I assume you mean to highlight the element so you can determine if the right element is being found.
You can use the Element#flash method. This method will change the background of the element a couple of times, which should help you figure out what element was found.
For example:
browser.table.flash

How to change properties of elemnts\childs created with script on flash builder

Hi guys im creating/adding elemnts in my item renderer but from some reason you cant access their specific properties, you can only change the general properties. I created a LABEL component but when i do LabelName.font , nothing happens, its like flex doesnt recognize that this is a LABEL. Here is my code
var mylabel:Label = new Label()
mylabel.font
when i do "mylabel.someProperty" it only shows the general properties of any component, but how can i change other properties like font,color,size etc..
Thanks ahead [=
Fonts are defined as styles in Flex, not propeties, so you need to use the setStyle method to update it. (Not my favorite part about Flex.) For example:
myLabel.setStyle('fontFamily', newFont)
There is a difference between MXML and ActionScript in this. In MXML, styles of a component are shown as if they were properties, when they are really not. To set the fontFamily of your label in AS3 code, for example, you would use
myLabel.setStyle("fontFamily", "Arial")

are scala's mouse events working? how?

I'm trying to create link-like label in scala. But no mouse events works for me. How are they supposed to work?
class Hyperlink extends Label{
text = "hyperlink"
reactions += {
case MouseClicked(_,_,_,_,_) =>
println("mouse clicked")}}
I put this in some panel and click over the label like a pro minesweeper player... and nothing shows up in console. Why?
You need to listenTo the relevant thing, something like:
listenTo(this.mouse.clicks)
Edit: since 2.8.0 Mouse is deprecated, use mouse instead
Maybe this should have been a comment to the previous answer, but due to my rep, i cant add comments.
this.Mouse is deprecated and this.mouse should be used instead. Also, this might be a good resource: http://www.scala-lang.org/sid/8